# Declarations #================================================================= use warnings; no warnings 'uninitialized'; use strict; use CGI (); use Template; use Time::Piece; # Program proper #================================================================= my $template = Template->new(); my $utc_date_from_a_db = '2004-10-18 03:32:11'; my $data = { utc_date => Time::Piece->strptime($utc_date_from_a_db, "%Y-%m-%d %k:%M:%S"), }; print CGI::header(), CGI::start_html('Localized Date with JavaScript via Perl'); $template->process(\*DATA, $data); __END__