我正在尝试使用以下代码将 8/17/2003
转换为 boot::gregorian::date
std::string test = "08/17/2013";
date d(from_simple_string(test));
但是我得到了一个未处理的异常,关于如何完成这个有什么建议吗?
最佳答案
来自 boost 示例:
// The following date is in ISO 8601 extended format (CCYY-MM-DD)
std::string s("2001-10-9"); //2001-October-09
date d(from_simple_string(s));
std::cout << to_simple_string(d) << std::endl;
您的格式不正确。
关于c++ - 将 8/17/2003 转换为 boost::gregorian::date,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18107627/