Gossamer Forum
Home : General : Perl Programming :

Different time zones problem

Quote Reply
Different time zones problem
Ok, I'm having a little problem with this routine. I'm in Europe, and my server is in California. As I don't know PERL, I'd like someone, please, to tell me how to make this routine, and $jam variable show mt time zone (CET - Central European Time). Tnx in advance...

---------CUT HERE-------------

$time = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($time+($HourOffset*3600));
$ampm = "am";
if ($hour eq 12) { $ampm = "pm"; }
if ($hour eq 0) { $hour = "12"; }
if ($hour > 12) {
$hour = ($hour - 12);
$ampm = "pm";
}
if ($min < 10) { $min = "0$min"; }
$year = 1900+$year;

$hari ="$days[$wday]";
$tanggal = "$mday $months[$mon], $year";
$jam = "$hour\:$min $ampm";
$special = "$months[$mon]$year";
---------CUT HERE----------------
Quote Reply
Re: Different time zones problem In reply to
Just set $HourOffset to however many hours you are ahead. So if you are 10 hours ahead, set $HourOffset = 10 and you should be fine.

Cheers,

Alex
Quote Reply
Re: Different time zones problem In reply to
 How to do it with Links Manager?
I mean, how to add some hours or get out some hours from the server time?

Thiago Moretti