![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re^3: How to convert time from one time zone to anotherby robin (Chaplain) |
on Dec 19, 2005 at 21:51 UTC ( #517910=note: print w/replies, xml ) | Need Help?? |
You have a good point. There is a frustrating trade-off, in that “numeric pseudo-timezones” are pretty portable. The named (Olson) timezones still won’t work everywhere, unfortunately, although the situation is improving.
If portability is not a concern, and the Olson names work on your system, you should definitely use them. If you need to be portable and to deal with all the intricacies of daylight saving time, you probably have to use DateTime with DateTime::TimeZone (which parses the Olson database) (Unless there's a better way that I don't know about?) Update: Actually I think the module is distributed with a pre-parsed copy of the database, so at least you don't have to worry about that. It's still a lumbering behemoth whose documentation is rather confusing, at least to me; but it should give accurate results at least.
In Section
Seekers of Perl Wisdom
|
|