[Pythonmac-SIG] time screwed up
John W Baxter
jwblist@olympus.net
Wed, 19 Apr 2000 15:51:04 -0700
At 10:25 -0500 4/19/2000, Chris wrote:
>>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))
>
>
>That's correct, but asctime(), etc or not mac tool box calls,
>they're C library calls. With MetroWerks Standard Library, these
>calls, follow the POSIX standard in using 1900 as the epoch.
Thanks...right you are. When I write code for Mac, I write code for Mac,
using Mac toolbox. So I've never exercised that part of the libraries,
which Python quite rightly uses.
>
>Dosn't someone have a date/time class? Perhaps converting all times to
>this might be easer than remembering to add 60*60*24*365*4 to all the mac
>times.
You are short 86400 seconds with that adjustment: 1900 was a leap year
(discounting the few countries which were still on the Julian calendar
then). But you're right...doing it in a class is the right way.
--John
--
John Baxter jwblist@olympus.net Port Ludlow, WA, USA