【发布时间】:2018-06-06 12:41:31
【问题描述】:
这类似于How to get the current time zone?
#include <ctime>
tzset();
time_zone_ptr zone(new posix_time_zone(tzname[localtime(0)->tm_isdst]));
以上代码抛出“bad cast”异常。来自 tzname 或 GetTimeZoneInformation 的时区是 'China Standard Time' 之类的字符串,Boost 时区不接受。
有没有简单的方法来解决这样一个基本问题?
【问题讨论】:
标签: c++ boost boost-date-time