The CALDAT procedure computes the month, day, year, hour, minute, or second corresponding to a given Julian date. The inverse of this procedure is JULDAY.
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
caldat.pro
in the
lib
subdirectory of the IDL distribution.
A numeric value or array that specifies the Julian Day Number (which begins at noon) to be converted to a calendar date.
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. CALDAT follows this convention, as illustrated by the following commands:
CALDAT, 2299160, Month, Day, Year
CAUTION: You should be aware of this discrepancy between the original and revised Julian calendar reckonings if you calculate dates before October 15, 1582.
Be sure to distinguish between Month and Minute when assigning variable names:
CALDAT, 2529161.36, M, D, Y, H, M, S ; Find date corresponding to Julian day 2529161.36.
CALDAT, 2529161.36, Month, Day, Year, Hour, Minute, Second
PRINT, Month, Day, Year, Hour, Month, Second
9 19 1938 6 0 0.0000000
;
This is the correct value,
September 19, 1938.
; The Minute value is incorrect; it is the same as the Month value.
You can use arrays for the Julian argument: