summaryrefslogtreecommitdiff
path: root/lib/timelocal.pl
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1993-02-04 22:50:33 +0000
committerLarry Wall <lwall@netlabs.com>1993-02-04 22:50:33 +0000
commite334a159a5616cab575044bafaf68f75b7bb3a16 (patch)
tree47369293eb7417e5322f7fe46e1a1cfc0d9c69ef /lib/timelocal.pl
parent514dae0dba791ec01681adb3b3946a7646e146b3 (diff)
downloadperl-e334a159a5616cab575044bafaf68f75b7bb3a16.tar.gz
perl 4.0 patch 36: (combined patch)perl-4.0.36
Since Ed Barton sent me a patch for the malignent form of "Malformed cmd links", I finally broke down and made a patch for the various other little things that have been accumulating on version 4.
Diffstat (limited to 'lib/timelocal.pl')
-rw-r--r--lib/timelocal.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/timelocal.pl b/lib/timelocal.pl
index 5be3840035..95b47e1ef9 100644
--- a/lib/timelocal.pl
+++ b/lib/timelocal.pl
@@ -36,6 +36,7 @@ CONFIG: {
$MIN = 60 * $SEC;
$HR = 60 * $MIN;
$DAYS = 24 * $HR;
+ $YearFix = ((gmtime(946684800))[5] == 100) ? 100 : 0;
}
sub timegm {
@@ -65,6 +66,7 @@ sub cheat {
die "Month out of range 0..11 in ctime.pl\n" if $month > 11;
$guess = $^T;
@g = gmtime($guess);
+ $year += $YearFix if $year < $epoch[5];
while ($diff = $year - $g[5]) {
$guess += $diff * (363 * $DAYS);
@g = gmtime($guess);