America/Sao_Paulo DST problem
Olson, Arthur David (NIH/NCI)
olsona at dc37a.nci.nih.gov
Thu May 27 17:50:23 UTC 2004
Here are a few lines of "zdump" output for America/Sao_Paulo:
America/Sao_Paulo Sun Oct 19 03:00:00 2003 UTC = Sun Oct 19
01:00:00 2003 BRST isdst=1
America/Sao_Paulo Sun Feb 15 01:59:59 2004 UTC = Sat Feb 14
23:59:59 2004 BRST isdst=1
America/Sao_Paulo Sun Feb 15 02:00:00 2004 UTC = Sat Feb 14
23:00:00 2004 BRT isdst=0
America/Sao_Paulo Sun Oct 17 02:59:59 2004 UTC = Sat Oct 16
23:59:59 2004 BRT isdst=0
The important thing to note is at midnight on February 14 clocks are set
back an hour.
This means that there are two instants when a well-maintained Sao Paulo wall
clock would read 11:00:00 PM on February 14
(as well as two instants when it would 11:00:01, 11:00:02, and so on through
11:59:59).
The "my_date.c" program feeds year-mon-mday-hour-min-sec into mktime; the
values being fed in lie in the "fall back" hour above.
Mktime is supposed to return an instant when a wall clock shows the time
that's been input to it; here, since there are two such instants (and since
"tm_isdst" has been set to -1), mktime is allowed to pick either instant to
return. It's luck of the draw that determines which instant mktime returns.
--ado
More information about the tz
mailing list