Time zone confusion and implementation hints

David Patte dpatte at relativedata.com
Fri Jul 2 16:59:31 UTC 2010

Paul Eggert wrote:
> Hey, it's not _that_ cryptic!  But I'm afraid that it's the
> canonical version.  (Perhaps you can find an old, doddering
> C expert nearby who can explain it to you. :-)

Since i've been coding C algorithms since the era of the first Vax 
machines - i may actually qualify as doddering :)

Yves, there are of course, many approaches to analysing the data, but 
parsing (or compiling) the files in the gz into zone, link, rule records 
is fairly straightforward. You can then sort the records, remove 
redundant records, and link the structures.

The resulting table can then searched using binary searching and a 
little bit of table walking to identify the rule in effect for a 
particular zone & time. You can then apply your time offsets at that 
point in the structure, to determine the corresponding wall, standard, 
and univeral times.

I have acquired permission from this end to produce a commercial DLL to 
wrap our tz parser and time converter algorithms as a licensable product 
if there is enough interest.

I might even be able to convince the boss to let me release it as open 
source - but that would take some convincing ....if anyone has 
suggestions i can relay, i can pass them on.

More information about the tz mailing list