【发布时间】:2019-02-12 08:53:58
【问题描述】:
const boost::posix_time::ptime now;
boost::posix_time::second_clock::local_time();
now.date().year();
now.date().month();
now.date().day();
now.time_of_day().hours();
now.time_of_day().minutes();
now.time_of_day().seconds();
我想出了如何使用 boost::posix_time::ptime 获取年、月、日、小时、分钟和秒。
但我无法获得亚秒级的 ptime。有什么方法可以得到毫秒、微秒或纳秒?
谢谢。
【问题讨论】: