mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
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:
parent
e22a4e573a
commit
874b8a3e19
1 changed files with 9 additions and 1 deletions
10
win32/time.c
10
win32/time.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue