Time zone confusion and implementation hints

David Patte dpatte at relativedata.com
Thu Jul 1 21:47:05 UTC 2010


Hi Yves

I have implemented two functions which use the tz database. They are 
original code written in standard C++, that are based on internal tables 
read directly from tz gz files.

1) SetWT(const string &zonename, const RDTime &wt)
2) SetUT(const string &zonename, const RDTime &ut)

The first takes a current zonename (ie: 'America/Montreal')  and its 
wall time and fills a data structure with the matching wall, standard 
and ut times with zone strings ('EDT','EST')

The second is the same, except that it takes a local zonename and the 
current ut.

Combined, these two functions can convert any datetime in the 
past/future to another datetime in a different zone.

I'd show you the code but unfortunately they are part of a series of 
commercial products.

But perhaps I can give you some input on how it was implemented, or if 
there is enough interest I could convince the boss to release licenced 
lib files for a small cost.

David Patte
Senior Designer, C++
Relative Data Inc.
 
 
Yves Goergen wrote:
> Hi,
>
> I'm currently implementing an API for the tz database that should look
> like .NET's TimeZoneInfo class to replace that in my application. The
> API includes:
....



More information about the tz mailing list