It appears that Mathematica treats all dates as proleptic Gregorian dates by default, a hypothesis that can be easily tested by using AbsoluteTime to compute the Julian Day:
jd[t_] := AbsoluteTime[t]/86400 + 2.4150205*^6
but, while this works for recent dates and for some older ones, it yields results that differ from the correct result for some older dates by exactly a day
jd[{2012, 11, 24, 12}] - 2456256
0
jd[{1100, 11, 24, 12, 0, 0}] - 2123154
0
jd[{-3000, 11, 24, 12, 0, 0}] - 625660
1
notably for the reference date, 12:00 Universal Time on January 1, 4713 BCE in the proleptic Julian calendar (-4713-11-24 in the proleptic Gregorian calendar):
jd[{-4713, 11, 24, 12, 0, 0}]
1
What calendar is Mathematica using for these older dates, if not the proleptic Gregorian calendar?
Here, perhaps is another clue:
DateList[{-4713, 11, 24, 12, 0, 0}]
{-4713, 11, 25, 12, 0, 0}
DateList[{-3000, 11, 24, 12, 0, 0}]
{-3000, 11, 25, 12, 0, 0}
I'm no calendar expert, but this "canonicalization" doesn't map to any calendar I'm familiar with. Is this a bug?
Update: Version 9, behaves differently:
jd[{2012, 11, 24, 12}] - 2456256
0.
jd[{1100, 11, 24, 12, 0, 0}] - 2123154
0.
jd[{-3000, 11, 24, 12, 0, 0}] - 625660
365.
jd[{-4713, 11, 24, 12, 0, 0}]
366
and
DateList[{-4713, 11, 24, 12, 0, 0}]
{-4713, 11, 24, 12, 0, 0.}
DateList[{-3000, 11, 24, 12, 0, 0}]
{-3000, 11, 24, 12, 0, 0.}
Get["!date +%s"]) to compute JD? – J. M.'s missing motivation Nov 25 '12 at 04:15Get["!date +%s"]just computes Unix time! What I wanted to say was that you could try reckoning the formula for JD based on Unix time, and then compare with the method usingAbsoluteTime[]and the true JD. – J. M.'s missing motivation Nov 25 '12 at 04:43AbsoluteTime[{2009,01,01,0,0,0}]-AbsoluteTime[{2008,12,31,23,59,59}]gives1instead of the correct2, assuming the standard UTC+Gregorian. – Mechanical snail Nov 25 '12 at 08:24AstronomicalDataskips leap seconds, but reports results as if there were no gap). – orome Nov 26 '12 at 03:12DateListdoes (did) indeed seem to have a bug (that's now fixed). I'm not sure what's going on withAbsoluteTime, but it's probably not the way to calculate JD. – orome Nov 29 '12 at 18:25AbsoluteTime[{2009, 01, 01, 0, 0, 0}] - AbsoluteTime[{2008, 12, 31, 23, 59, 59}]still gives1, in version 9.0, rather than 2. – orome Nov 29 '12 at 18:28DateListwas a bug in version 8. It remains to be seen whyAbsoluteTimeadded a day in 8 and a year in 9. – orome Dec 08 '12 at 18:01