11 Nov
2005
11 Nov
'05
5:37 p.m.
I am trying to parse ISO datetime strings with millisecond resolution and the fractional seconds are being truncated. Am I doing something wrong in the following code? Thanks, Sean Rohead
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <string> #include "boost/date_time/posix_time/posix_time.hpp" using namespace std; using namespace boost::posix_time; void main() { string dateString1 = "20051004T151801"; string dateString2 = "20051004T151801.123"; ptime timestamp1(from_iso_string(dateString1)); ptime timestamp2(from_iso_string(dateString2)); cout << timestamp1 << endl; cout << timestamp2 << endl; }