
Hi: Within a string I have a date in the format: 22 July 2009 How can I input this in to the boost::datetime library as I need to transform it in to another format. As far as I can tell, the constructor of boost::gregorian::date doesn't takethis format as one of it's string parameters. Cheers Sean.

Hi: I’ve found this. There appears to be no format flags, that give me both a two digit month, i.e 22 and four digit year i.e 2009. Have I missed something. Sean. From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Surya Kiran Gullapalli Sent: 19 October 2009 10:14 To: boost-users@lists.boost.org Subject: Re: [Boost-users] date time format 22 July 2009 How can I input this in to the boost::datetime library as I need to transform it in to another format. boost::date_time::date_input_facet Surya

On Tue, Oct 20, 2009 at 9:49 AM, Sean Farrow
Hi:
I’ve found this. There appears to be no format flags, that give me both a two digit month, i.e 22 and four digit year i.e 2009.
Have I missed something.
Sean.
you can do something like this. boost::date_time::date d ; std::istringstream is ; is.imbue(std::locale (std::cout.getloc(), new boost::date_time::date_input_facet ("%d %B %Y")) is.str(*"22 July 2009"*); is >> d ; Format flags are documented at http://www.boost.org/doc/libs/1_40_0/doc/html/date_time/date_time_io.html#da... Surya

Hi:
Thanks, works perfectly, after modifying to Widestring variants.
Regards
Sean.
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Surya Kiran Gullapalli
Sent: 20 October 2009 08:25
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] date time format
On Tue, Oct 20, 2009 at 9:49 AM, Sean Farrow
participants (2)
-
Sean Farrow
-
Surya Kiran Gullapalli