我想知道是否有办法转换字符串
28-Dec-2013 05:33:10 PM
到ptime ??
我尝试过这样的事情
ptime time(time_from_string("28-Dec-2013 05:33:10 PM"));
但那不起作用?
有什么建议吗?
我也尝试过以下
boost::posix_time::ptime abs_time;
std::string mydate = "28-Dec-2013 05:33:10 PM";
boost::posix_time::time_input_facet *tif = new boost::posix_time::time_input_facet("%d-%b-%Y %I:%M:%S %p");
std::istringstream iss(mydate);
iss.imbue(std::locale(std::locale::classic(), tif));
iss >> abs_time;
然而,当我在abs_time
时,我得到a not-a-date-time