mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
fix Win32 ngx_gettimezone()
This commit is contained in:
parent
694bdea2a9
commit
b533e98252
@ -60,11 +60,23 @@ ngx_libc_gmtime(time_t s, struct tm *tm)
|
|||||||
ngx_int_t
|
ngx_int_t
|
||||||
ngx_gettimezone(void)
|
ngx_gettimezone(void)
|
||||||
{
|
{
|
||||||
|
u_long n;
|
||||||
TIME_ZONE_INFORMATION tz;
|
TIME_ZONE_INFORMATION tz;
|
||||||
|
|
||||||
if (GetTimeZoneInformation(&tz) != TIME_ZONE_ID_INVALID) {
|
n = GetTimeZoneInformation(&tz);
|
||||||
return -tz.Bias;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
switch (n) {
|
||||||
|
|
||||||
|
case TIME_ZONE_ID_UNKNOWN:
|
||||||
|
return -tz.Bias;
|
||||||
|
|
||||||
|
case TIME_ZONE_ID_STANDARD:
|
||||||
|
return -(tz.Bias + tz.StandardBias);
|
||||||
|
|
||||||
|
case TIME_ZONE_ID_DAYLIGHT:
|
||||||
|
return -(tz.Bias + tz.DaylightBias);
|
||||||
|
|
||||||
|
default: /* TIME_ZONE_ID_INVALID */
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user