Boost logo

Boost Users :

Subject: [Boost-users] Boost 1.42.0: DateTime ISO Timestamp Parsing Fix
From: Peter Klotz (Peter.Klotz_at_[hidden])
Date: 2010-07-13 05:53:06


Boost.DateTime 1.42.0 falsely converts "20100713" into "20100713T201007.300000" using from_iso_string().

Example Code:

const boost::posix_time::ptime time=boost::posix_time::from_iso_string("20100713");
std::cout << boost::posix_time::to_iso_string(time) << std::endl;

Current Result: 20100713T201007.300000

The error is caused by boost::date_time::split().

The attached patch corrects split() so that an exception is thrown later in parse_delimited_time_duration().

We assume this behaviour to be better than creating a ptime that contains wrong values.

Regards, Peter.




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