Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Time::Local; #get the time in Sydney, regardless of what the server may be configur +ed for my @dayofweek = (qw(Sunday Monday Tuesday Wednesday Thursday Friday Sa +turday)); my @monthnames = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)) +; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday); #$ENV{TZ} = ':/usr/share/zoneinfo/Australia/Sydney'; $ENV{TZ} = ':/usr/share/zoneinfo/Europe/Paris'; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = localtime($TimeInSeco +nds); $year += 1900; print "This date is $dayofweek[$wday], $monthnames[$mon] $mday, $year\ +n"; print "This time is $hour:$min:$sec\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: different time zones
by jethro (Monsignor) on Aug 07, 2008 at 01:29 UTC | |
by Anonymous Monk on Aug 07, 2008 at 01:41 UTC | |
|
Re: different time zones
by Illuminatus (Curate) on Aug 07, 2008 at 04:46 UTC |