[Cppcms-users] booster::date_time parsing
Brought to you by:
artyom-beilis
From: Pavel K. <un...@fu...> - 2011-03-16 20:01:25
|
hello Artyom, first of all, great work ;). combination your framework together with mongodb and graphicsmagick is amazingly _fast_ and pleasure to use. i have 2 questions about booster::date_time / timezone: 1) should parsing handle time before unix era (1970...)? example: std::string tz = "Europe/Prague"; booster::locale::calendar cal( context().locale(), tz ); booster::locale::date_time dt( cal ); std::stringstream ss; ss.imbue( cal.get_locale() ); ss << "1955-07-21 07:21:07"; // produce 1969-01-01 01:00:00 //ss << "1985-07-21 07:21:07"; // works as expected ss >> booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) >> dt; std::cout.imbue( cal.get_locale() ); std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt << std::endl; booster::locale::date_time dt2( cal ); dt2 -= 50 * booster::locale::period::year; // works as expected // 1961-03-16 ... std::cout << booster::locale::as::ftime( "%Y-%m-%d %H:%M:%S" ) << dt2 << std::endl; 2) is there a way how to obtain all available timezones? currenty i use icu::TimeZone::createEnumeration() directly. pavel _ uni. |