mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Retrieve the timezone bias in mktime via GetTimeZoneInformation
svn path=/trunk/; revision=42428
This commit is contained in:
parent
7dc02145d2
commit
1a3dc30655
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,8 @@ mktime_worker(struct tm * ptm, int utc)
|
||||||
struct tm *ptm2;
|
struct tm *ptm2;
|
||||||
__time64_t time;
|
__time64_t time;
|
||||||
int mons, years, leapyears;
|
int mons, years, leapyears;
|
||||||
|
TIME_ZONE_INFORMATION tzi;
|
||||||
|
DWORD ret;
|
||||||
|
|
||||||
/* Normalize year and month */
|
/* Normalize year and month */
|
||||||
if (ptm->tm_mon < 0)
|
if (ptm->tm_mon < 0)
|
||||||
|
@ -84,7 +86,11 @@ mktime_worker(struct tm * ptm, int utc)
|
||||||
*ptm = *ptm2;
|
*ptm = *ptm2;
|
||||||
|
|
||||||
/* Finally adjust by the difference to GMT in seconds */
|
/* Finally adjust by the difference to GMT in seconds */
|
||||||
time += _timezone;
|
ret = GetTimeZoneInformation(&tzi);
|
||||||
|
if (ret != TIME_ZONE_ID_INVALID)
|
||||||
|
{
|
||||||
|
time += tzi.Bias * 60;
|
||||||
|
}
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue