JULDAY

The JULDAY function calculates the Julian Date (which begins at noon) for the specified date. This is the inverse of the CALDAT procedure.

Notes

Examples

In 1582, Pope Gregory XIII adjusted the Julian calendar to correct for its inaccuracy of slightly more than 11 minutes per year. As a result, the day following October 4, 1582 was October 15, 1582. JULDAY follows this convention, as illustrated by the following commands:

PRINT, JULDAY(10,4,1582), JULDAY(10,5,1582), JULDAY(10,15,1582)

IDL prints:

2299160    2299161    2299161

Using arrays, this can also be calculated as follows:

PRINT, JULDAY(10, [4, 5, 15], 1582)

If you are using JULDAY to calculate an absolute number of days elapsed, be sure to account for the Gregorian adjustment.

Syntax

Result = JULDAY(Month, Day, Year, Hour, Minute, Second [, /MODIFIED])

Return Value

Result is of type double-precision if Hour, Minute, or Second is specified, otherwise Result is of type long integer. If all arguments are scalar, the function returns a scalar. If all arguments are arrays, the function matches up the corresponding elements of the arrays, returning an array with the same dimensions as the smallest array. If the inputs contain both scalars and arrays, the function uses the scalar value with each element of the arrays, and returns an array with the same dimensions as the smallest input array.

Arguments

If no arguments are given then the Julian date corresponding to the current system time is returned.

Month

Number of the desired month (1 = January, ..., 12 = December). Month can be either a scalar or an array.

Day

Number of the day of the month (1-31). Day can be either a scalar or an array.

Year

Number of the desired year (e.g., 1994). Year can be either a scalar or an array.

Hour

Number of the hour of the day (0-23). Hour can be either a scalar or an array.

Minute

Number of the minute of the hour (0-59). Minute can be either a scalar or an array.

Second

Number of the second of the minute (0-59). Second can be either a scalar or an array.

Keywords

MODIFIED

Set this keyword to return the Modified Julian Date, which is the regular Julian Date minus 2400000.5. Modified Julian dates have a precision of approximately 1.2x10–11 (equal to 1x10–6 seconds).

Note: When converting Modified Julian Date to and from date/times, be sure to specify the MODIFIED keyword on all calls to JULDAY and CALDAT.

Version History

Original

Introduced

8.8.3 Added MODIFIED keyword

See Also

BIN_DATE, CALDAT, GREG2JUL, JUL2GREG, SYSTIME, Date/Time Data