JULDAY

The JULDAY function calculates the Julian Day Number for a given month, day, and year. This is the inverse of the CALDAT procedure. JULDAY returns the Julian Day Number (which begins at noon) of the specified calendar date.

This routine is written in the IDL language. Its source code can be found in the file julday.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = JULDAY( Month, Day, Year , Hour, Minute, Second )

Arguments

Month

Number of the desired month (1 = January, ..., 12 = December).

Day

Number of the day of the month (1-31).

Year

Number of the desired year (e.g., 1994).

Hour

Number of the hour of the day (0-23) .

Minute

Number of the minute of the day (0-1439).

Second

Number of the second of the day (0-86399).

Example

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

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

See Also

BIN_DATE , CALDAT , JUL_TO_DT , SYSTIME