<%perl> sub printv { my $key = shift; return $key; } sub dateTime { my $i; my %result; my @datetime = localtime(time); $datetime[5] += 1900; $datetime[4] += 1; for ($i=0; $i < 5; $i++){ $datetime[$i] = sprintf("%02d",$datetime[$i]); } my $dateString = $datetime[5] . "-" . $datetime[4]. "-" . $datetime[3] . " " . $datetime[2] . ":" . $datetime[1] . ":" . $datetime[0]; $result{'asString'} = $dateString; $result{'asTimestamp'} = time; return %result; }