timezone conversions

  • Thread starter Zebee Johnstone
  • Start date
Z

Zebee Johnstone

I have machines in 3 different timezones.

I have a monitoring program that sends me email, and I use GMT in the
subject line and in the log recordings so it's easy to spot when
things are happening at the same physical time without having to
convert time differences in my head.

However, I'd like to add a note of current time in my home timezone in
Australia to the emails.

Date::Manip can do it, but would have to be told whether or not to use
daylight saving time for my home timezone.

Is there a perl way to tell Date::Manip whether it's daylight saving time
in Sydney or not so it knows whether to use AEST or AEDT? Or a shell
command on linux to parse?


Zebee
 
T

Tim Heaney

Zebee Johnstone said:
However, I'd like to add a note of current time in my home timezone in
Australia to the emails.

I think I might use Class::Date

use Class::Date qw(date);
my $date = date(time);
print $date->to_tz('Australia/Sydney'), "\n";

or Date::Handler

use Date::Handler;
my $date = new Date::Handler({ date => time });
$date->TimeZone('Australia/Sydney');
print scalar $date->LocalTime(), "\n";

I hope this helps,

Tim
 
Z

Zebee Johnstone

In comp.lang.perl.misc on Sun, 05 Dec 2004 21:39:07 -0500
Tim Heaney said:
or Date::Handler

use Date::Handler;
my $date = new Date::Handler({ date => time });
$date->TimeZone('Australia/Sydney');
print scalar $date->LocalTime(), "\n";

I hope this helps,

yes, thank you!

I used Date::Handler because I found it was useful for some other
things.

Zebee
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top