I discovered a strange result in Boost C++ date time library. There is inconsistency between microsec_clock
and second_clock
, and I don't understand why is that. I am using Windows XP 32-bits
My snip of code:
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;
...
The print-out I expected are current time without miliseconds and with milliseonds. However, what I have in my pc is:
2009-10-14T16:07:38 1970-06-24T20:36:09.375890
I don't understand why there is a weired date (year 1970???) in my microsec_clock
time. Related documentation for Boost: link to boost date time
Newbie in Boost, any suggestion will help.
Lily