
12 Jun
2009
12 Jun
'09
3:36 p.m.
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 '' I figure I'm missing something simple. (when I try a different format: "%b %e %Y %H:%M:%S" for "Feb 28 2009 11:15:11" I get a "Year is out of valid range: 1400..10000" exception??) Thanks for any insight. joe