将2003年8月17日转换为boost::gregori::date



我正试图使用以下代码将8/17/2003转换为boot::gregorian::date

std::string test = "08/17/2013";
date d(from_simple_string(test)); 

然而,我得到了一个未处理的异常——关于如何实现这一点,有什么建议吗?

来自升压示例:

// 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;

您的格式不正确。

最新更新