[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JULDAY trivia



I've been updating some of my own date and time routines and found
myself perusing the JULDAY man page.  As an example, the man page gives
Julian day numbers bracketing the period when the changeover from the
Julian to Gregorian calendar was carried out:

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

2299160 2299161 2299161

If I understand correctly, October 5-14 of 1582 never existed.  JULDAY,
howver, gives the following:

IDL> FOR day = 4, 16 DO PRINT, day, JULDAY(10, day, 1582)
       4     2299160
       5     2299161
       6     2299162
       7     2299163
       8     2299164
       9     2299165
      10     2299166
      11     2299167
      12     2299168
      13     2299169
      14     2299170
      15     2299161
      16     2299162

Not that I'm ever likely to ask for the Julian day of 5 October 1582,
but shouldn't JULDAY choke here, as it does if you use year = 0?  

IDL> PRINT, JULDAY(1,1,0)
% JULDAY: There is no year zero.
% Error occurred at:  JULDAY             87
  /flow0/local/rsi/idl_5.3/lib/julday.pro

Especially since CALDAT will not invert JULDAY during this period:

IDL> CALDAT, JULDAY(10, 10, 1582), month, day, year
% Compiled module: CALDAT.
IDL> PRINT, month, day, year
          10          20        1582



Ken