Boost logo

Boost :

Subject: Re: [boost] [datetime] IANA Time Zone Database
From: Maxim Yegorushkin (maxim.yegorushkin_at_[hidden])
Date: 2012-11-09 10:59:16


On 09/11/12 14:38, Artyom Beilis wrote:

[]

> First you can create boost::locale::calendar using TZ name
>
> http://www.boost.org/doc/libs/1_52_0/libs/locale/doc/html/classboost_1_1locale_1_1calendar.html#af9538c3aab4b8eaf7229ed2d9af18328
>
>
>
> Than you create a date_time object using calendar and than setup all parameters you need.
>
> http://www.boost.org/doc/libs/1_52_0/libs/locale/doc/html/classboost_1_1locale_1_1date__time.html#a871745debde77a28f5fbc6e2b2a5f869
>
>
> It should be something like
> using namespace boost::locale::period;
> boost::locale::date_time dt(
> year(2012) + month(10) + day(9) + hour(10) + minute(19) + second(0),
> boost::locale::calendar("Europe/Paris"));
>
> Than you can get a POSIX time from it dt.time(), print it to stream with UTC time zone or
> create other date_time object like
>
> boost::locale::date_time dt_utc(dt.time(),boost::locale::calendar("UTC"));
>
> And fetch its parameters.
>
> I hadn't tested the chunk of code above but this is a general direction.

Thanks again Artyom, this is exactly what I was looking for.

-- Maxim


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