mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Merge pull request #210 from GreatFruitOmsk/master
Fix throwing exception if DYNAMIC_TIME_ZONE_INFORMATION fails
This commit is contained in:
commit
5202a7806f
@ -199,7 +199,7 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
|
|||||||
auto rv = GetDynamicTimeZoneInformation(&tzinfo);
|
auto rv = GetDynamicTimeZoneInformation(&tzinfo);
|
||||||
#endif
|
#endif
|
||||||
if (rv == TIME_ZONE_ID_INVALID)
|
if (rv == TIME_ZONE_ID_INVALID)
|
||||||
throw spdlog::spdlog_ex("Failed getting timezone info. Last error: " + GetLastError());
|
throw spdlog::spdlog_ex("Failed getting timezone info. Last error: " + std::to_string(GetLastError()));
|
||||||
|
|
||||||
int offset = -tzinfo.Bias;
|
int offset = -tzinfo.Bias;
|
||||||
if (tm.tm_isdst)
|
if (tm.tm_isdst)
|
||||||
|
Loading…
Reference in New Issue
Block a user