
22 Mar
2006
22 Mar
'06
4:09 p.m.
Thank you very much. I was not paying to attention. My fault. For the records, here is a sample that works: date_input_facet* pMyFacet = new date_input_facet( "%m-%d-%Y" ); std::istringstream oo; oo.imbue( std::locale(oo.getloc(), pMyFacet )); oo.str( "11-03-2006" ); date myDate; try { oo >> myDate; date::ymd_type ymd = myDate.year_month_day(); std::cout << myDate; } catch( std::out_of_range oEx ) { std::cout << "Error: " << oEx.what() << std::endl; } Unfortunately a string like "11-3-1997" wont work since the day is just a single digit. Is that something the date_time lib will be able to understand in the future? Thanks, Christian