use DateTime; use DateTime::TimeZone; #my $timezone_name = 'America/New_York'; my $timezone_name = 'UTC'; my $dt = DateTime->now(time_zone => $timezone_name); my $offset = $dt->offset(); print "Timezone: $timezone_name\n"; print "Offset: $offset seconds\n";