您的位置:首页 > 编程语言 > C语言/C++

C++boost获取当前日期时间中的日期和时间

2013-07-20 13:30 351 查看
date myDate;
myDate = from_undelimited_string("20131202");
cout << to_iso_string(myDate) << endl;

time_duration myTime;
myTime = duration_from_string("09:58");
time_duration myOtherTime;
myOtherTime = duration_from_string("09:10");

cout << myTime.minutes() - myOtherTime.minutes() << endl;

ptime myPTime3 = second_clock::local_time(); //获取当前时间比如:20130716T164620
date myDate = day_clock::local_day(); //获取当前日期比如:20130716
cout << to_iso_string(myDate) << endl;;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: