
22 Mar
2006
22 Mar
'06
3:30 p.m.
Alexandre, the following code will give an exception stating "Error: Year is out of valid range: 1400..10000". I don't think the myDate object is correctly initialized. Can you check this on your machine, please. Can you call myDate.year_month_day()? date_input_facet* pMyFacet = new date_input_facet( "%m-%d-%Y" ); std::locale loc( std::locale::classic(), pMyFacet ); std::istringstream oo; oo.str( "22-03-2006" ); date myDate; try { oo >> myDate; date::ymd_type ymd = myDate.year_month_day(); } catch( std::out_of_range oEx ) { std::cout << "Error: " << oEx.what() << std::endl; } Thanks ahead, Christian