julian(X)

Returns the number of days remaining until the epoch for a date-related value (using a similar convention to the Julian date).

Syntax

julian(X)

Input

Argument Type Description
X any numeric type A scalar value or the name of a column containing date-related values
Valid values can be of the form:
  • date
  • date+time

For more information, see Dates and time.

Return Value

Returns an integer value representing the number of days before the epoch for the date-related value given as input.

The calculation uses 1/1/2035 as the epoch (or reference) point. The value is typically negative because the count uses the epoch as the starting point and counts backwards to the given date or date+time.
Note: This does not conform to the official scientific definition of Julian dates.

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

Example

In the Hourly U.S. Weather (1993) table (pub.demo.weather.hourly93), you can create a computed column that displays an integer value corresponding to the number of days from the epoch (1/1/2035) to the date value in the column named date:

<base table="pub.demo.weather.hourly93"/>
<willbe name="example" value="julian(date)" label="Julian Date"/>
<colord cols="date,example"/>

For a date value of 08/23/90 (X=19900823), the result would be -16,202. (There are 16,202 days from 8/23/90 to 1/1/2035.)