At 07:48 -0700 2001.04.18, Andrew O. Mellinger wrote:
>I'd have to agree with Jake here.  This is odd.  When I run the
>following snipper on my Mac I get:
>
>$t1 = 0;
>@c = gmtime($t1);
>print "GMT:   $t1 = @c \n";
>@c = localtime($t1);
>print "Local: $t1 = @c \n";
>
>   We see:
>
>GMT:   0 = 0 0 7 1 0 4 5 0 1
>Local: 0 = 0 0 0 1 0 4 5 0 1
>
>   (I'm in pacific time with daylight savings time so I am have a UTC of -7)

Looks right to me, except for maybe the "1" in the last column for GMT,
since GMT is never in DST (in MacPerl 5.6.1, it prints 0 for that column).


>If I run that same code snippet on different linux boxes I get.
>
>GMT:   0 = 0 0 0 1 0 70 4 0 0
>Local: 0 = 0 0 16 31 11 69 3 364 0

That all looks fine.  But now I think I see your confusion.

Mac OS' epoch is, indeed, midnight on Jan 1 1904 _local time_.  So your
epoch changes as your timezone changes.  This is why your makefiles, CVS,
synchronization tools, etc. get confused around DST (for those who have
seen this happen).

It may suck, but that is the way it is.  :-)

Although now that I look at it, this is not documented in perlport.  I'll
attempt to rectify that.


>Chris Nandor, are you reading this?  Is the MacPerl source available?

Yep.  See the appopriate links on http://macperl.sourceforge.net/.  For the
5.2.0r4 source, follow the links to 5.2.0r4; a source archive is available
for download.  The 5.6 source is available via CVS, FTP, and HTTP.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to