#!/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();
Simply placing the mkent's line:
my $time = timelocal($sec,$min,$hhour,$day,$month,$year);
should work in the same way provided MarkM's advice is followed:
my $time = timelocal($sec,$min,$hhour,$day,$month-1,$year-=1900);
So finally we have:
#!/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();
The truth is in there. Somewhere.
|