develooper Front page | perl.datetime | Postings from January 2003

Timezone data project for interested coder

Dave Rolsky
January 18, 2003 15:28
Timezone data project for interested coder
Message ID:
Right now I'm working on taking the Date::ICal::Timezone code from the
Reefknot project and reworking it a bit to fit into the DateTime project

Right now this mostly consists of renaming packages, tweaking some of the
code, and making it fit the API I want.

But the current code relies on having a database of VTIMEZONE info.
VTIMEZONE is a time zone description format defined by the ICal RFC
(2445).  Basically, VTIMEZONE has the same data as the Olson database, but
in a more machine readable format.

Unfortunately, promises to contrary from 2 years back on "the timezone"
list (run by the Olson DB maintainers), there is no authoritative source
for VTIMEZONE data, to the best of my knowledge.  Furthermore, VTIMEZONE
uses the ICal format internally (both for dates and recurrence rules), I'm
trying to move ICal format handling out of the core objects.

Even more annoying, to generate the VTIMEZONE needed to generate the time
zone info needed for the modules, I have to run an Olson -> VTIMEZONE
converter which is not really still in development, AFAICT
(  In fact, the libical
project CVS contains VTIMEZONE files which are around 14 months old,
despite the fact that the Olson db has been updated 4 times in 2002.

So what I'd really like to have is a Perl Olson parser that generated a
tree or something that could be queried.  This'd be useful in general, and
would let us skip a step and dependency in handling time zones.

Unfortunately, the only existing parsers are in C (ugh).

Useful URLS: - Olson DB and associated tools

tzdata<year><rev>.tar.gz is the database

tzcode<year><rev>.tar.gz is some source for TZ tools including zic, which
compiles the Olson DB down to the binary format found on most Unix
systems.  May be useful for reference.

Olson -> VTIMEZONE convert.  Another reference for parsing.

Also do "man zic" on your system, which at least on mine includes an
explanation of the Olson DB file format.


House Absolute Consulting
=======================*/ Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About