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.
NOTE: The Julian calendar, established by Julius Caesar in the year 45 BCE, was corrected by Pope Gregory XIII in 1582, excising ten days from the calendar. The CALDAT procedure reflects the adjustment for dates after October 4, 1582. See the example below for an illustration.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
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: