
13 Jun
2009
13 Jun
'09
4:34 p.m.
On Fri, 12 Jun 2009 17:36:39 +0200, Joe Nardone
I'm trying to get input facets working for dates and times using time_input_facet.
(Boost 1.33.1 on RHEL5; upgrading is not an option at the moment)
std::stringstream ss; ss.str("Feb 28 16:22:11 2009"); time_input_facet* tf = new time_input_facet("%b %e %H:%M:%S %Y"); ss.imbue(std::locale(std::locale::classic(), tf)); ss.exceptions(std::ios_base::failbit);
ptime z; ss >> z;
std::cout<< z << std::endl;
This throws an exception - Parse failed. No match found for ''
Replace %e with %d and try "%b %d %H:%M:%S %Y". Boris