我在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