Re: [Cppcms-users] Parsing time from a string into date_time?
Brought to you by:
artyom-beilis
|
From: <ele...@ex...> - 2012-04-19 10:34:12
|
Does this work for both string-to-date_time as wells as date_time-to-string?
I'm aware of strftime, and all, but that's in reverse. I'm looking for
something like time_input_facet that's in boost::posix_time allowing me to
parse a string/char into time.
Perhaps something like
istringstram ss("2001-12-12");
date_time dt;
ss >> format("%Y-%m-%d") >> dt;
would be really handy. The examples of date and time formatting on the
page you pointed out seem to only show output streams (date to string
formatting), but maybe I'm not seeing something obvious in which case I
apologize.
Cheers
Petr
> To parse date-time read
>
>
> http://www.boost.org/doc/libs/1_49_0/libs/locale/doc/html/formatting_and_parsing.html
>
> Just change "boost" to "booster"
>
> Note to parse booster::locale::date_time you need to compile CppCMS with
> ICU.
>
|