On 10/14/06, Dave Rolsky <[EMAIL PROTECTED]> wrote:
This is in 0.51. It's a bit different from what you wrote. The biggest
difference is that you can only get the zones by country code. I didn't
want to add a dependency on Locale::Country, but I did mention it in the
docs.

Looks like you sort the names per country, but the zone.tab file has a
meaning in its order, which is quite useful. Quote,

 # The table is sorted first by country, then an order within the country that
 # (1) makes some geographical sense, and
 # (2) puts the most populous zones first, where that does not contradict (1).

So, names_in_country('US')->[0] would be better 'America/New_York'
instead of 'America/Adak', and names_in_country('CN')->[0] would be
better 'Asia/Shanghai' instead of 'Asia/Chongqing'.

If users want the sorted list, we can just do

 @names = sort DateTime::TimeZone->names_in_country('US');

Can you remove the 'sort' from the following code in parse_olson?

       $countries .= join "\n", map { "    $_" } sort @{ $countries{$c} };

Thanks,

--
Tatsuhiko Miyagawa

Reply via email to