Thanks to ysth for doing a lot of work on top the of timezone updates that I started a week or so back. Several descriptions were cleaned up.

We've now added timezones for

We removed several timezones that no longer change for daylight-savings time / summer time and so were pretty redundant (Ghana, Sierra Leone, South Korea, Marshall Islands, and Tonga).

I separated the Middle East into its own section as the "Asia (except for Russia)" section was large enough.

I wrote (as I mentioned briefly) a Perl script to check for timezones that were currently the same or are nearly the same. Of the between 440 and 600 timezones in different versions of the standard timezone database, only about 80 represent real differences in what time is reported these days (most record historical differences in time readings).

So we should now have all unique timezones represented in Timezone Settings.

Note that we didn't include most timezones that differ only by what abbreviation they use (unless they also observed daylight-savings time or "summer" time). This is because you can pick your own custom abbreviation for such cases by changing your "Format for date-times" in User Settings (instead of using "%Z").

The Perl script that I used is included below. Note that it doesn't detect when the change between daylight-savings / "summer" time is different but in the same month. Thanks to ysth for noting that Tasmania was just such an exception.

- tye        

#!/usr/bin/perl -w use strict; use Time::Local qw( timelocal timegm ); use POSIX qw( strftime ); my $zid= '/usr/share/zoneinfo'; Main( @ARGV ); exit( 0 ); sub FindFiles { my( $av, $pref )= @_; $pref .= "/" if $pref; for( glob( "$pref*" ) ) { if( ! -l $_ && -d _ ) { FindFiles( $av, $_ ); } elsif( -f $_ ) { push @$av, $_; } } } sub Main { chdir $zid or die "Can't cd to $zid: $!$/"; my @zones; FindFiles( \@zones, '' ); @zones= [@zones]; my @parts= ( 00, 00, 12, 01, 00, 2004 ); my %s; for my $mo ( 0..11 ) { warn 'Month ',1+$mo,$/; my @new; for my $z ( @zones ) { $parts[4]= $mo; my %g; for my $zone ( @$z ) { $ENV{TZ}= $zone; my $time= timelocal(@parts); my $dif= $time-timegm(@parts); push @{$g{$dif}}, $zone; $dif /= 60*60; my $s= strftime("%Z",localtime($time)); $s{$zone}{"$dif $s"}= 1; } push @new, values %g; } @zones= @new; } warn 0+@zones, " unique zones.$/"; for my $z ( @zones ) { for my $zone ( @$z ) { print join( ' ', $zone, keys %{$s{$zone}} ), $/; } print $/; } }

In reply to Re: Time Zones (updates!) by tye
in thread Time Zones by jonnybe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.