This code won't work on all systems. The C library may cache the timezone information between calls to localtime(3). If you set the TZ environment variable, you need to call tzset(3), which is avilable in the POSIX Perl module.
use POSIX;
print scalar(localtime),"\n";
{
local $ENV{'TZ'} = 'AST4ADT';
POSIX::tzset;
print scalar(localtime),"\n";
}
POSIX::tzset;
print scalar(localtime),"\n";