Corrected a problem in GetTimeZoneInformation() due a change to

mktime() in glibc-2.1.1 when daylight saving time is in effect.
This commit is contained in:
Rein Klazes 1999-06-12 06:39:22 +00:00 committed by Alexandre Julliard
parent e22a4e573a
commit 874b8a3e19

View file

@ -103,11 +103,19 @@ BOOL WINAPI SetSystemTime(const SYSTEMTIME *systime)
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo)
{
time_t gmt, lt;
struct tm *ptm;
int daylight;
memset(tzinfo, 0, sizeof(TIME_ZONE_INFORMATION));
gmt = time(NULL);
lt = mktime(gmtime(&gmt));
ptm=localtime(&gmt);
daylight=ptm->tm_isdst;
ptm = gmtime(&gmt);
ptm->tm_isdst=daylight;
lt = mktime(ptm);
tzinfo->Bias = (lt - gmt) / 60;
tzinfo->StandardBias = 0;
tzinfo->DaylightBias = -60;