gregor(X)

Returns the date corresponding to the given number of days before the epoch (1/1/2035).

Syntax

gregor(X)

Input

Argument Type Description
X
  • integer
  • big integer
A value (or column name containing values) corresponding to the number of days before the epoch for a particular date

The value is typically expressed as a negative number because the count is backwards from the epoch (1/1/2035).

For more information, see Dates and time.

Note: Support for columns of type big integer available as of version 11.25.

Return Value

Returns an integer value (in date form) representing the date that is X days before the epoch (1/1/2035).

If the input values are not in one of the supported formats listed above, the function returns an erroneous or illogical output.

Example

You can create a computed column that displays the date corresponding to a particular number of days before the epoch (1/1/2035):

<base table="pub.demo.weather.hourly93"/>
<willbe name="example" value="gregor('-8935')" label="Gregorian Date"/>
<colord cols="example"/>

The computed column will show the date value 07/16/10 (X=20100716). (There are 8,935 days from 7/16/10 to 1/1/2035.)