Actually you might want to use:
use POSIX qw( tzset ) sub localtime_in { local $ENV{TZ} = shift; tzset; localtime } $localtime_in_EST = localtime_in( "EST" );
Otherwise you've globally change the timezone for any other calls to (gm|local)time elsewhere in your code.
And personally I've used both some variant of twiddling $ENV{TZ} like this and DateTime.
In reply to Re^2: Finding a remote time
by Fletch
in thread Finding a remote time
by Moron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |