root/misc/worlddate

Revision 1954 (checked in by miyagawa, 14 years ago)

added worlddate

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use DateTime;
5 use DateTime::TimeZone;
6
7 my @tz = (
8     'UTC',
9     'Pacific/Honolulu',
10     'America/Los_Angeles',
11     'America/Chicago',
12     'America/New_York',
13     'Europe/London',
14     'Europe/Paris',
15     'Europe/Berlin',
16     'Europe/Rome',
17     'Europe/Madrid',
18     'Asia/Jakarta',
19     'Asia/Bangkok',
20     'Asia/Taipei',
21     'Asia/Shanghai',
22     'Asia/Hong_Kong',
23     'Asia/Tokyo',
24     'Australia/Sydney',
25     'Pacific/Auckland',
26 );
27
28 my $now = DateTime->now;
29 for my $tz (@tz) {
30     $now->set_time_zone($tz);
31     my $date = $now->ymd('/') . ' ' . $now->hms(':');
32     my $is_dst = $now->is_dst ? '*' : '';
33     print "$date $tz$is_dst\n";
34 }
35
Note: See TracBrowser for help on using the browser.