Boost logo

Boost :

Subject: Re: [boost] [datetime] IANA Time Zone Database
From: Joshua Boyce (raptorfactor_at_[hidden])
Date: 2012-11-08 22:24:50


On Fri, Nov 9, 2012 at 4:54 AM, Jeff Garland <azswdude_at_[hidden]> wrote:

> On Thu, Nov 8, 2012 at 10:36 AM, Maxim Yegorushkin <
> maxim.yegorushkin_at_[hidden]> wrote:
>
> >
> > Oh, thanks Artyom.
> >
> > That is quite a surprising place to find this functionality. Not sure why
> > it is not in datetime library.
> >
> > Anyway, I managed to get a small test working:
> >
> > #include <iostream>
> > #include <sstream>
> > #include <boost/locale.hpp>
> >
> > int main() {
> > boost::locale::generator gen;
> > std::locale::global(gen("en_**GB.UTF-8"));
> > std::cout.imbue(std::locale())**;
> >
> > boost::locale::date_time d;
> > std::istringstream ss("8 Nov 2012 17:00:00");
> > ss >> boost::locale::as::time_zone("**America/New_York") >> d;
> >
> > std::cout << boost::locale::as::time_zone("**UTC") << d << '\n';
> > // prints 8 Nov 2012 22:00:00
> > }
> >
> > Thanks a lot!
> >
> >
> > -- Maxim
> >
> >
> Yes, surprising -- obviously I've been asleep b/c I was completely unaware
> of this work...seems like we now have a lot of library duplication :-(
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

The Boost.Locale docs explain why it it has its own date and time
functionality rather than using or building on for example Boost.DateTime:
http://www.boost.org/doc/libs/1_52_0/libs/locale/doc/html/dates_times_timezones.html


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk