Reproducing merlyn's article we get:
Simply placing the mkent's line:#!/usr/bin/perl -w use strict; use CGI ':standard'; use Time::Local; my $time = timelocal(0,0,0,1,0,100); my $string = localtime $time; print header(), start_html(-title => ""); print "the big ball falls at $time => $string\n"; print end_html();
should work in the same way provided MarkM's advice is followed:my $time = timelocal($sec,$min,$hhour,$day,$month,$year);
So finally we have:my $time = timelocal($sec,$min,$hhour,$day,$month-1,$year-=1900);
The truth is in there. Somewhere.#!/usr/bin/perl -w use strict; use CGI ':standard'; use Time::Local; my $sec = "50"; my $min = "20"; my $hhour = "10"; my $day = "12"; my $month = "12"; my $year = "2002"; my $time = timelocal($sec,$min,$hhour,$day,$month-1,$year-=190 +0); my $string = localtime $time; print header(), start_html(-title => ""); print "the big ball falls at $time => $string\n"; print end_html();
In reply to In defence of merlyn...
by jonnyfolk
in thread Error from timelocal
by mkent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |