Boost logo

Boost Users :

From: Sean Rohead (sean.rohead_at_[hidden])
Date: 2005-11-11 12:37:09


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;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net