current time in different timezones incl DST

M

Marcus

Im currently calculating the current time for cities around the globe,
based on my servers time, trying to keep track on DST dates in a
separete file to make it accurate(ish).

Im sure there are solid solutions out there to do this? Eg, print the
current time in New York, Berlin, Sydney etc.

Thanks for any suggestions
M
 
G

Gregory Toomey

Marcus said:
Im currently calculating the current time for cities around the globe,
based on my servers time, trying to keep track on DST dates in a
separete file to make it accurate(ish).

Im sure there are solid solutions out there to do this? Eg, print the
current time in New York, Berlin, Sydney etc.

Thanks for any suggestions
M

Screen scrape the offsets from http://www.timeanddate.com/worldclock/

gtoomey
 
D

Darren Dunham

Marcus said:
Im currently calculating the current time for cities around the globe,
based on my servers time, trying to keep track on DST dates in a
separete file to make it accurate(ish).
Im sure there are solid solutions out there to do this? Eg, print the
current time in New York, Berlin, Sydney etc.

I would normally just use the OS's support for this..

my @cities_to_timezone = (
[ "New York", "US/Eastern" ],
[ "Berlin", "Europe/Berlin"],
[ "Sydney", "Australia/NSW"],
);

foreach (@cities_to_timezone)
{
$ENV{'TZ'} = $_->[1];
print $_->[0], ": ", scalar localtime, "\n";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top