Fixes for SystemTimeToTzSpecificLocalTime() and

TzSpecificLocalTimeToSystemTime().
This commit is contained in:
Martin Fuchs 2003-04-17 02:14:38 +00:00 committed by Alexandre Julliard
parent 3f7c3ff76e
commit 6a7d463ca6
1 changed files with 9 additions and 9 deletions

View File

@ -296,7 +296,7 @@ static BOOL _GetTimezoneBias(
LONG* pBias) /* [out] The calulated bias in minutes */ LONG* pBias) /* [out] The calulated bias in minutes */
{ {
int ret; int ret;
BOOL beforedaylightsaving, afterdaylightsaving; BOOL beforeStandardDate, afterDaylightDate;
BOOL daylightsaving = FALSE; BOOL daylightsaving = FALSE;
LONG bias = lpTimeZoneInformation->Bias; LONG bias = lpTimeZoneInformation->Bias;
@ -313,19 +313,19 @@ static BOOL _GetTimezoneBias(
} }
/* check for daylight saving */ /* check for daylight saving */
ret = _DayLightCompareDate(lpSystemTime, &lpTimeZoneInformation->StandardDate); ret = _DayLightCompareDate(lpSystemTime, &lpTimeZoneInformation->StandardDate);
if (ret == -2) if (ret == -2)
return FALSE; return FALSE;
beforedaylightsaving = ret < 0; beforeStandardDate = ret < 0;
_DayLightCompareDate(lpSystemTime, &lpTimeZoneInformation->DaylightDate); ret = _DayLightCompareDate(lpSystemTime, &lpTimeZoneInformation->DaylightDate);
if (ret == -2) if (ret == -2)
return FALSE; return FALSE;
afterdaylightsaving = ret >= 0; afterDaylightDate = ret >= 0;
if (!beforedaylightsaving && !afterdaylightsaving) if (beforeStandardDate && afterDaylightDate)
daylightsaving = TRUE; daylightsaving = TRUE;
} }
@ -426,7 +426,7 @@ BOOL WINAPI TzSpecificLocalTimeToSystemTime(
t <<= 32; t <<= 32;
t += (UINT)ft.dwLowDateTime; t += (UINT)ft.dwLowDateTime;
if (!_GetTimezoneBias(&tzinfo, lpUniversalTime, &lBias)) if (!_GetTimezoneBias(&tzinfo, lpLocalTime, &lBias))
return FALSE; return FALSE;
bias = (LONGLONG)lBias * 600000000; /* 60 seconds per minute, 100000 [100-nanoseconds-ticks] per second */ bias = (LONGLONG)lBias * 600000000; /* 60 seconds per minute, 100000 [100-nanoseconds-ticks] per second */