This is the mail archive of the
mailing list for the Cygwin project.
Re: date and TZ
- To: cygwin at sourceware dot cygnus dot com
- Subject: Re: date and TZ
- From: Randolph Back <v2rback at btv dot ibm dot com>
- Date: Tue, 12 Oct 1999 08:58:56 -0400
The reason date and time is failing at this time has to do with the
Win32 GetTimeZoneInformation function and its use in the winsup/times.cc
the localtime() function. Fortunately, there is a simple work around.
GetTimeZoneInformation returns the "date" that standard time starts and
savings time starts. The return value can be easily confused because
may be in one of two formats, one of which is NOT a date.
For the beginnning of standard time, my system was returning a "date" of
meaning that daylight time would end on the last sunday of October. The
year of 0000 indicates that the "date" is not a date but an encoding of
the rules for daylight savings time. The POSIX tzinfo uses a similar
format, but does not shove the information into
a structure normally used for dates.
Unfortunately the Cygwin localtime function interpreted this to mean
October 5, whence
it went back to standard time on Tuesday, October 5.
The workaround is to call SetTimeZoneInformation in a Win32 program and
correct date of October 31, 1999. This information will be saved in the
CGYWIN programs will return the correct time (at least until next
hopefully we'll all be running a version with support for TZ.
Want to unsubscribe from this list?
Send a message to firstname.lastname@example.org