mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-06 15:04:49 +08:00
Merge pull request #149 from yaoyuan1216/SupportForWINNT_WS03
Replace GetDynamicTimeZoneInformation to GetTimeZoneInformation.
This commit is contained in:
commit
b187976141
@ -166,8 +166,13 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
(void)tm; // avoid unused param warning
|
(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;
|
DYNAMIC_TIME_ZONE_INFORMATION tzinfo;
|
||||||
auto rv = GetDynamicTimeZoneInformation(&tzinfo);
|
auto rv = GetDynamicTimeZoneInformation(&tzinfo);
|
||||||
|
#endif
|
||||||
if (!rv)
|
if (!rv)
|
||||||
return -1;
|
return -1;
|
||||||
return -1 * (tzinfo.Bias + tzinfo.DaylightBias);
|
return -1 * (tzinfo.Bias + tzinfo.DaylightBias);
|
||||||
|
Loading…
Reference in New Issue
Block a user