Boost logo

Boost Users :

Subject: [Boost-users] datetime will not be parsed
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-08-06 07:06:22


Hello,

I use this code for parsing a string into a datetime:

boost::local_time::local_date_time l_datetime(boost::date_time::not_a_date_time);
std::istringstream l_datestream("Sat Aug 06 10:52:26 +0000 2011");
                
l_datestream.imbue( std::locale( std::locale::classic(), new boost::local_time::local_time_input_facet("%a %b %d %H:%M:%S %q %Y")) );
l_datestream >> l_datetime;

But the l_datetime is always set to "not a date time". I think the parameter within the input facet are correct, so I don't understand
why the string is not be parsed. Can anyone help me please to create a working solution?

Thanks

Phil



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