From 1b3946cf65ad22ae175241640aa06a09dadc4f66 Mon Sep 17 00:00:00 2001 From: yaoyuan1216 Date: Fri, 20 Nov 2015 16:25:33 +0800 Subject: [PATCH] Replace GetDynamicTimeZoneInformation to GetTimeZoneInformation. --- include/spdlog/details/os.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 75cc5887..ea078876 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -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);