summaryrefslogtreecommitdiff
path: root/lib/Time/Local.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Time/Local.pm')
-rw-r--r--lib/Time/Local.pm7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm
index f5bb4bb3aa..d80d6c8e2a 100644
--- a/lib/Time/Local.pm
+++ b/lib/Time/Local.pm
@@ -7,7 +7,7 @@ use strict;
use integer;
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
-$VERSION = '1.15';
+$VERSION = '1.16';
@ISA = qw( Exporter );
@EXPORT = qw( timegm timelocal );
@@ -91,9 +91,6 @@ sub _timegm {
sub timegm {
my ( $sec, $min, $hour, $mday, $month, $year ) = @_;
- # Need to check leap year before altering the value
- my $leap_year = _is_leap_year($year);
-
if ( $year >= 1000 ) {
$year -= 1900;
}
@@ -114,7 +111,7 @@ sub timegm {
my $md = $MonthDays[$month];
++$md
- if $month == 1 && $leap_year;
+ if $month == 1 && _is_leap_year( $year + 1900 );
croak "Day '$mday' out of range 1..$md" if $mday > $md or $mday < 1;
croak "Hour '$hour' out of range 0..23" if $hour > 23 or $hour < 0;