boost posix_time格式化输出

1.格式化输出本地时间:

boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
boost::posix_time::time_facet* tf = new boost::posix_time::time_facet("%Y-%m-%d %H:%M:%S");
std::stringstream ss;
ss.imbue(std::locale(std::cout.getloc(), tf));
ss << pt;



你可能感兴趣的:(facet)