tz and DateTime::TimeZone

Dave Rolsky autarch at urth.org
Sun Oct 12 17:40:22 UTC 2003


On Sun, 12 Oct 2003, Paul Eggert wrote:

> Thanks for the heads-up.  I'll propose something like the following
> xhtml in my next proposed tz update.  Comments welcome.  (I must
> confess that at Twin Sun we've avoided DateTime in our Perl code for
> performance reasons -- I didn't know it had tz support these days.)

Hmm?  It's had tz support since the very beginning.  In fact, one of the
main reasons for writing _new_ modules was to provide a useful Perl API to
the Olson database, since previously the only way to do anything with
timezones was to do something like "$ENV{TZ} = 'foo/bar'; POSIX::tzset()".
That won't get you very far if you need to deal with datetimes in
_multiple_ timezones all at once.

As for performance, it's definitely slower than a lot of the alternatives,
except for those cases where it's the _only module_ that does what you
need, which is true for quite a number of things.

> <li><a
> href="http://search.cpan.org/dist/DateTime-TimeZone/">DateTime::TimeZone</a>
> contains a script <code>parse_olson</code> that compiles
> <code>tz</code> source into <a href="http://www.perl.org/">Perl</a>
> modules. It is part of the Perl <a
> href="http://datetime.perl.org/">DateTime Project</a>, which is freely
> available under both the GPL and the Perl <a
> href="http://www.perl.com/language/misc/Artistic.html">Artistic
> License</a>. DateTime::TimeZone also contains a script
> <code>tests_from_zdump</code> that generates test cases for each clock
> transition in the <code>tz</code> database.</li>

Looks good.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/



More information about the tz mailing list