date_time库之date类
调用
date d1; date d2(2019, 1, 1); date d3(2018, Jan, 5); date d4(d2); std::cout << day_clock::local_day() << std::endl; std::cout << d2 << std::endl;
头文件
#include <boost/date_time/gregorian/gregorian.hpp> using namespace boost::gregorian;
也可以如下调用
date d1 = from_string("1999-12-31");
date d2(from_string("2015/1/1"));
date d3 = from_undelimited_string("20191112");

浙公网安备 33010602011771号