Cae*_*sar 8 c++ boost boost-date-time
const boost::posix_time::ptime now= boost::posix_time::second_clock::local_time();
year_ = now.date().year();
month_ = now.date().month();
day_ = now.date().day();
Run Code Online (Sandbox Code Playgroud)
这就是我如何获得boost :: posix_time :: ptime的年,月和日,但我无法弄清楚如何获得小时,分钟和秒.你能帮帮我吗?
Cae*_*sar 14
答案是
now.time_of_day().hours();
now.time_of_day().minutes();
now.time_of_day().seconds();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10351 次 |
| 最近记录: |