#define BOOST_DATE_TIME_SOURCE
#include <boost/date_time/gregorian/gregorian.hpp>
using namespace boost::gregorian;
date d1; (d1 == date(not_a_date_time));
date d2(2010,1,1), d3(2010,Jan, 1); // d2 == d3
date d4(d2);
date d1 = from_string("2013-5-1");
date d2 = from_string("2013/5/1");
date d3 = from_undelimited_string("20130501"); // 需要补零
输出
to_simple_string(date) 2013-May-01
to_iso_string(date) 20130501
to_iso_extended_string() 2013-05-01
07-20
07-20
07-20
07-20
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交