summaryrefslogtreecommitdiff
path: root/lib/Time
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2002-02-19 23:08:47 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2002-02-20 00:56:21 +0000
commite7ec2331900cd22a50f48dd01fa18bd3026f6253 (patch)
tree18a9c5fa78c7ee50f5325e13143cb7405162b681 /lib/Time
parent194eaab5cca55296d59afbf5a12ff47445ad3b49 (diff)
downloadperl-e7ec2331900cd22a50f48dd01fa18bd3026f6253.tar.gz
Re: Cannot handle date (0, 0, 0, 2, 0, 1970)
Message-Id: <20020219230847.G66560@pobox.com> p4raw-id: //depot/perl@14777
Diffstat (limited to 'lib/Time')
-rw-r--r--lib/Time/Local.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm
index 126c3657ea..686a3d855e 100644
--- a/lib/Time/Local.pm
+++ b/lib/Time/Local.pm
@@ -2,10 +2,11 @@ package Time::Local;
use 5.006;
require Exporter;
use Carp;
+use Config;
use strict;
use integer;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
our @ISA = qw( Exporter );
our @EXPORT = qw( timegm timelocal );
our @EXPORT_OK = qw( timegm_nocheck timelocal_nocheck );
@@ -25,10 +26,8 @@ my (%Options, %Cheat);
my $Epoc = 0; $Epoc = _daygm(gmtime(0));
%Cheat=(); # clear the cache as epoc has changed
-my $MaxDay = do {
- no integer;
- int((~0>>1-43200)/86400)-1;
-};
+my $MaxInt = ((1<<(8 * $Config{intsize} - 2))-1)*2 + 1;
+my $MaxDay = int(($MaxInt-43200)/86400)-1;
sub _daygm {