#!perl -w
use warnings;
use strict;
use Time::Local;
my $time = time;
print "Epoch time: $time\n";
print "ctime time: ",scalar(localtime($time)),"\n";
print " localtime: ",join(", ",localtime($time)),"\n";
print " timelocal: ",timelocal(localtime($time)),"\n";
####
Epoch time: 1111461913
ctime time: Mon Mar 21 22:25:13 2005
localtime: 13, 25, 22, 21, 2, 105, 1, 79, 0
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm
line 76.
Use of uninitialized value in integer multiplication (*) at C:/Perl/lib/Time/Loc
al.pm line 76.
Use of uninitialized value in integer multiplication (*) at C:/Perl/lib/Time/Loc
al.pm line 76.
Use of uninitialized value in pack at C:/Perl/lib/Time/Local.pm line 67.
Use of uninitialized value in pack at C:/Perl/lib/Time/Local.pm line 67.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm
line 68.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm
line 69.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm
line 67.
timelocal: 1111461913
####
# Line 24 immediately below
my $SecOff = 0;
# Line 66 immediately below
sub _daygm {
$_[3] + ($Cheat{pack("ss",@_[4,5])} ||= do {
my $month = ($_[4] + 10) % 12;
my $year = $_[5] + 1900 - $month/10;
365*$year + $year/4 - $year/100 + $year/400 + ($month*306 + 5)/10 - $Epoc
});
}
# Line 75 immediately below
sub _timegm {
my $sec = $SecOff + $_[0] + 60 * $_[1] + 3600 * $_[2];
no integer;
$sec + 86400 * &_daygm;
}