AppLib JULIAN DAY TO TIMESTAMP

From Eigenpedia

Jump to: navigation, search

Contents

Syntax

APPLIB.JULIAN_DAY_TO_TIMESTAMP( julian_day )

Purpose

Converts Julian day (number of days from Julian start date) to a timestamp

NOTE: we do not calculate Julian days (JD) per the astronomical standard; they do not start noon Universal Time (UT) Monday, January 1, 4713 BC. So Julian days may not be in line with Julian days supplied by other systems. Also, Julian days for BC dates are not currently supported.

Parameters

  • julian_day [INTEGER] - a calendar date represented by the number of days from the Julian start date of 1 JAN -4712 (4713 BC)

Output

  • [TIMESTAMP] timestamp which is equivalent to julian_day number of days from the Julian start date of 1 JAN -4712 (4713 BC). Time portion of timestamp will be set to 00:00:00. Returns null if julian_day is null.

Example

SELECT JD, APPLIB.JULIAN_DAY_TO_TIMESTAMP ( JD ) ) from JULIAN_DAYS
Example:
JD APPLIB.JULIAN_DAY_TO_TIMESTAMP(JD)

Source Code

http://p4web.eigenbase.org/open/dev/luciddb/src/com/lucidera/luciddb/applib/datetime/ConvertJulianDayUdf.java

Personal tools