On Fri, 2005-Feb-11 21:16:00 -0200, Marcus Grando wrote: >I have problems with mktime() on FreeBSD 4.11-STABLE and daylight timezone. > >My timezone is "America/Sao_Paulo", daylight begin on 2004-11-02 00:00 >and terminate on 2005-02-20 00:00. > >The problem is: >If run this code[1] on FreeBSD 4.11-STABLE, then return -1, if run on >FreeBSD 5.3-STABLE, then return 1099364400 (correct) and if run on >Linux, then return 1099364400 (correct).
To be pedantic, FreeBSD 4.11 is correct and the others are wrong. If DST started at 2004-11-02 00:00 local time then you can't convert a local time of 2004-11-02 00:00:00 because that time doesn't exist - your local time goes 2004-11-01 23:59:59, 2004-11-02 01:00:00, 2004-11-02 01:00:01. server% TZ=':/usr/share/zoneinfo/America/Sao_Paulo' perl -e 'print scalar localtime 1099364400,"\n";' Tue Nov 2 01:00:00 2004 server% TZ=':/usr/share/zoneinfo/America/Sao_Paulo' perl -e 'print scalar localtime 1099364399,"\n";' Mon Nov 1 23:59:59 2004 server% -- Peter Jeremy _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "[EMAIL PROTECTED]"