Re: Letting users select timezone
[email protected] (Dave Rolsky)
| Newsgroups | perl.datetime |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 20 Jan 2009, Eugene van der Pijll wrote:
> Dave Rolsky schreef:
>> On Tue, 20 Jan 2009, Eugene van der Pijll wrote:
>>
>>> It may be useful if these kinds of lists were packaged and put on
>>> CPAN; maybe I'll do that at some time.
>>
>> If you generated this list programmatically, it'd be better to include it
>> in DateTime::TimeZone, since the list of what's unique can change with
>> each new release of the Olson database.
>
> It's partly programmatically, partly by hand. It's easy to write a
> script to make the list of "equivalent timezones". For example,
> America/Iqaluit is equivalent to America/Pangnirtung is equivalent to
> America/New_York.
>
> To select America/New_York for the list, and not Iqaluit, Pangnirtung,
> Vevay, Nipigon, or any other name, has to be done by hand.
Right, that makes sense.
Maybe we could stick the hand-picked list in DT::TZ and then for each
subsequent release check for any _new_ unaccounted for time zones, and do
something sane with them.
Presumably the unique list would be a data structure like this:
{ 'America/New_York' => [ 'America/Iqaluit', 'America/Pangnirtung' ],
....
}
That way if a new time zone comes up that isn't accounted for, we either
add it as a new unique name, or add it as match for some existing name.
It'd actually be a little more than just detecting new zones though, since
an existing zone could start matching something else, in which case it
needs to be moved.
I'd be willing to do this for each release, as long as I had a good tool
for telling me what needed review.
-dave
/*============================================================
http://VegGuide.org http://blog.urth.org
Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/