我在Boost C++日期时间库中发现了一个奇怪的结果。 microsec_clock
和second_clock
之间存在不一致,我不明白为什么。我使用的是Windows XP 32位Boost C++ date_time microsec_clock和second_clock
我的代码剪断:
using namespace boost::posix_time;
...
ptime now = second_clock::universal_time();
std::cout << "Current Time is: "<< to_iso_extended_string(now)<< std::endl;
ptime now_2 = microsec_clock::universal_time();
std::cout << "Current Time is: "<< to_iso_extended_string(now_2)<< std::endl;
...
打印出我的预期是当前时间不毫秒,并与milliseonds。不过,我在我的电脑是:
2009-10-14T16:07:38 1970-06-24T20:36:09.375890
我不明白为什么会出现在我的microsec_clock
时间是weired日期(1970年???)。为加速相关文档:link to boost date time
我正在使用Win32系统,Windows XP SP2 32位准确。 – Lily 2009-10-14 16:48:27
我已经在Eclipse 3.4.1和MingW 3.4中使用了1.39。此外,我有警告:说明\t \t资源路径\t \t位置类型 C:\t类型CommercialDetection线101 \t C/C的/boost/boost_1_39/boost/date_time/filetime_functions.hpp左移位计数> =宽度++问题如以及 – Lily 2009-10-14 19:15:51
嗯,我认为这个修正是在1.39,但我可以仔细检查。 – ephemient 2009-10-14 19:19:10