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

Re: [MacPerl] reverse localtime



At 10.05 +0000 2000.05.26, Bart Lateur wrote:
>>And timelocal doesn't even seem to
>>support day of year or daylight savings (according to the pod).
>
>GMT is independent of daylight savings time. It just goes on and on...
>forever.
>
>I thought timelocal() was exactly the opposite of localtime(). So if
>localtime() properly supports daylight saving time, so should
>timelocal(). Er... not on a Mac, I guess?

The problem may be that time() is the same, no matter what timezone you are
in, is the same on Unix.  On Mac OS, it is different depending on timezone.
time() in Mac OS is always seconds since Jan 01 1904 00:00:00 _local time_,
whereas in Unix, it is seconds since Jan 01 1970 00:00:00 _GMT_.  So when
you change timezones or go to or from DST, you add or subtract seconds to
your epoch.  If there is a difference, this may account for it.

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org