[Pythonmac-SIG] time screwed up

John W Baxter jwblist@olympus.net
Tue, 18 Apr 2000 21:07:35 -0700


I know of no calls in the Mac toolbox which use other than Jan 1 1904 as
the zero point of time (I wrote "start" but that's not the case, since the
modern routines are happy with negative time...happy in some sense but I
don't know what calendar is used).

At 9:45 -0700 4/18/2000, Corran Webster wrote:
>> >>> from time import *
>> >>> primt asctime(localtime(0))
>> Mon Jan  1 00:00:00 1900
>>
>> Shouldn't that be
>> Mon Jan  1 00:00:00 1904 ?
>
>Hmmm, it looks like the current Mac time routines (at least the ones used
>by Python) use 1900 as the epoch (look at your compiler's time.h for
>confirmation), while the apple event system uses 1904 (which my brain says
>is the start date that was used by the time routines a long time ago).
>Trying the script
>
>0 as date
>
>in the script editor returns
>
>date "Friday, 1 January 1904 12:00:00 AM"
>
>which seems to confirm this.

-- 
John Baxter   jwblist@olympus.net      Port Ludlow, WA, USA