sub CalcDay { my ($ts) = @_;
#$ts += $TimeZoneOffset;
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($ts); if ($NumberDates) { return ($year + 1900) . '-' . ($mon+1) . '-' . $mday; } return ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")[$mon]. " " . $mday . ", " . ($year+1900); } sub CalcTime { my ($ts) = @_; my ($ampm, $mytz);
#$ts += #$TimeZoneOffset;my ($sec, $min, $hour, $mday, $mon, $year) = localtime($ts); $mytz = ""; if (($TimeZoneOffset == 0) && ($ScriptTZ ne "")) { $mytz = " " . $ScriptTZ; } $ampm = ""; if ($UseAmPm) { $ampm = " am"; if ($hour > 11) { $ampm = " pm"; $hour = $hour - 12; } $hour = 12 if ($hour == 0); } $min = "0" . $min if ($min<10); return $hour . ":" . $min . $ampm . $mytz; } sub TimeToText { my ($t) = @_;$t-= $TimeZoneOffset;return &CalcDay($t) . " " . &CalcTime($t); }