| The glibc version of struct tm has additional fields
| long tm_gmtoff; /* Seconds east of UTC */
...so I'd say it's a (g)libc issue.
Try the Calendar module which should calculate the right thing,
| > Calendar.now()->utc_offset();
| (1) Result: -7200
/ Mirar
Previous text:
>2003-05-06 11:50:
>Subject: localtime
>--------------------------------------------------------------------
> Hi,
>
>I have a problem with Pike 7.2 and localtime. It looks like it returns
>different values on two machines:
>
>On one running FreeBSD (other poeple have the same results with
>Debian) from pike compiled from source:
>
>$ date
>Tue May 6 11:41:00 CEST 2003
>$ date -u
>Tue May 6 09:41:02 UTC 2003
>$ pike
>Pike v7.2 release 340 running Hilfe v2.0 (Incremental Pike Frontend)
>> localtime(time());
>Result: ([ /* 10 elements */
> "hour":11,
> "isdst":1,
> "mday":6,
> "min":33,
> "mon":4,
> "sec":54,
> "timezone":-7200,
> "wday":2,
> "yday":125,
> "year":103
> ])
>
>On a Debian woody from the pike package:
>
>$ date
>Tue May 6 11:41:04 CEST 2003
>$ date -u
>Tue May 6 09:41:05 UTC 2003
>$ pike
>Pike v7.2 release 340 running Hilfe v2.0 (Incremental Pike Frontend)
>> localtime(time());
>Result: ([ /* 10 elements */
> "hour":11,
> "isdst":1,
> "mday":6,
> "min":34,
> "mon":4,
> "sec":1,
> "timezone":-3600,
> "wday":2,
> "yday":125,
> "year":103
> ])
>
>The problem is in the timezone value (3600 and 7200).
>
>Do you have any ideads ?
>
>Thank you for your answers.
>
>--
> David Gourdelier
>
>
>
> / Brevbäraren
>