Amdes has asked for the wisdom of the Perl Monks concerning the following question:
OUTPUT#!/opt/perl/5.8.0/bin/perl use Time::Local; use strict; my $nowTime = time; my $winTime = timegm (0, 0, 9, 1, 0, 107); my $sumTime = timegm (0, 0, 9, 1, 6, 107); foreach my $e ($nowTime, $winTime, $sumTime) { foreach ("UTC","GB-Eire","Europe/London","CET","Europe/Warsaw","Euro +pe/Paris") { $ENV{TZ} = $_; print scalar localtime($e), " $ENV{TZ}"; print " (DST)" if ((localtime($e))[8]); print "\n"; } print "\n"; }
Thu Sep 20 19:53:10 2007 UTC Thu Sep 20 20:53:10 2007 GB-Eire (DST) Thu Sep 20 20:53:10 2007 Europe/London (DST) Thu Sep 20 21:53:10 2007 CET (DST) Thu Sep 20 21:53:10 2007 Europe/Warsaw (DST) Thu Sep 20 21:53:10 2007 Europe/Paris (DST) Mon Jan 1 09:00:00 2007 UTC Mon Jan 1 09:00:00 2007 GB-Eire Mon Jan 1 09:00:00 2007 Europe/London Mon Jan 1 10:00:00 2007 CET Mon Jan 1 09:00:00 2007 Europe/Warsaw Mon Jan 1 09:00:00 2007 Europe/Paris Sun Jul 1 09:00:00 2007 UTC Sun Jul 1 10:00:00 2007 GB-Eire (DST) Sun Jul 1 10:00:00 2007 Europe/London (DST) Sun Jul 1 11:00:00 2007 CET (DST) Sun Jul 1 11:00:00 2007 Europe/Warsaw (DST) Sun Jul 1 11:00:00 2007 Europe/Paris (DST)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $ENV{TZ} and localtime
by shmem (Chancellor) on Sep 20, 2007 at 21:12 UTC | |
by Amdes (Initiate) on Sep 20, 2007 at 21:57 UTC | |
by Amdes (Initiate) on Sep 20, 2007 at 22:24 UTC | |
by almut (Canon) on Sep 20, 2007 at 22:46 UTC |