8 Dec
2005
8 Dec
'05
6:41 a.m.
Hi all, I come across a bug in boost::posix_time::time_from_string(); try { ptime t1(time_from_string("2005-01-01")); cout << to_simple_string(t1) << endl; } catch (...) { cout << "exception thrown" << endl; } The above code will strangely output: "2005-Mar-25 13:01:01" time_from_string() will parse "2005-01-01 12", "2005-01-01 12:23" and "2005-01-01 12:23:33" correctly. It will even parse "2005-01-01 34" to the next day and output "2005-Jan-02 10:00:00" Does anyone have a fix for this bug? It should either parse correctly or it should throw an exception. Thanks Michael