|
Boost : |
Subject: Re: [boost] [datetime] IANA Time Zone Database
From: Jeff Garland (azswdude_at_[hidden])
Date: 2012-11-08 12:54:07
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 :-(
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk