JUL_TO_DT Function
Converts a Julian day number to a date/time variable.
Usage
result = JUL_TO_DT(julian_day)
Input Parameters
julian_day—A Julian day number or array of Julian day numbers.
Returned Value
resultΑ date/time variable containing the converted data.
Keywords
None.
Discussion
The date/time value is interpreted as a day in a series of days that begins on September 14, 1752. For example, 2 is equated with September 15, 1752. The decimal part of the Julian day indicates the time as a portion of the day. For example, for May 1, 1992 at 8:00 a.m, the Julian day is 84702.333.
Date/time calculation notes
It is possible when working with date/time functions for the Julian day to become out of sync with the remaining fields of the !DT structure. If you have noticed these changes while using the DT_COMPRESS Function or JUL_TO_DT Function, we recommend using the new keyword SetToZero when calling the DT_COMPRESS routine, and modifying the !DT_BASE system variable directly to an “empty” date/time variable by assigning !DT to !DT_BASE.
For example:
!DT_BASE = {!DT}
CREATE_WEEKENDS, ['Saturday', 'Sunday']
day1 = VAR_TO_DT(2015, 1, 1)
dt_array = DTGEN(day1, 366)
Julian_day = DT_COMPRESS(dt_array, /SETTOZERO)
result = JUL_TO_DT(Julian_day)
Example
; Converts the Julian day 87507 into a date/time variable.
dt = JUL_TO_DT(87507)
PRINT, dt
; PV-WAVE prints: {1992 4 15 0 0 0.00000 87507.000 0}
See Also
For more information, see the PV‑WAVE User’s Guide.