Commit 1b3946cf authored by yaoyuan1216's avatar yaoyuan1216

Replace GetDynamicTimeZoneInformation to GetTimeZoneInformation.

parent cbc8ba72
......@@ -166,8 +166,13 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
#ifdef _WIN32
(void)tm; // avoid unused param warning
#if _WIN32_WINNT < _WIN32_WINNT_WS08
TIME_ZONE_INFORMATION tzinfo;
auto rv = GetTimeZoneInformation(&tzinfo);
#else
DYNAMIC_TIME_ZONE_INFORMATION tzinfo;
auto rv = GetDynamicTimeZoneInformation(&tzinfo);
#endif
if (!rv)
return -1;
return -1 * (tzinfo.Bias + tzinfo.DaylightBias);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment