William Heath wrote:
The
trouble is I need to find the GMT offset for a timezone and I don't
know how to do this correctly for daylight saving time.
my $dt = new DateTime(
year => 2008,
month => 3,
day => 12,
hour => 16,
time_zone => 'Australia/Melbourne'
);
print $dt->offset; # in seconds
# 39600
printf( "%s%02d%02d",
$dt->offset >= 0 ? '+' : '-',
int($dt->offset / 60 / 60),
($dt->offset / 60) % 60
);
# +1100
--
Message protected for iSite by MailGuard: e-mail anti-virus, anti-spam and
content filtering.
http://www.mailguard.com.au