Skip Menu |

This queue is for tickets about the Math-Calc-Units CPAN distribution.

Report information
The Basics
Id: 124521
Status: new
Priority: 0/
Queue: Math-Calc-Units

People
Owner: Nobody in particular
Requestors: bitcardbmw [...] lsmod.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.07
Fixed in: (no value)



Subject: dates mishandled after 2025
man Time::Local says Years in the range 0..99 are interpreted as shorthand for years in the rolling "current century," defined as 50 years on either side of the current year. Thus, today, in 1999, 0 would refer to 2000, and 45 to 2045, but 55 would refer to 1955. Twenty years from now, 55 would instead refer to 2055. This is messy, but matches the way people currently think about two digit dates. Whenever possible, use an absolute four digit year instead. please apply the attached fix
Subject: perl-Math-Calc-Units-fixtime.patch
Index: Math-Calc-Units-1.07/Units/Convert/Date.pm =================================================================== --- Math-Calc-Units-1.07.orig/Units/Convert/Date.pm +++ Math-Calc-Units-1.07/Units/Convert/Date.pm @@ -4,8 +4,8 @@ use Time::Local qw(timegm); use strict; use vars qw(%units %pref %ranges %total_unit_map); -my $min_nice_time = timegm(0, 0, 0, 1, 0, 1975-1900); -my $max_nice_time = timegm(0, 0, 0, 1, 0, 2030-1900); +my $min_nice_time = timegm(0, 0, 0, 1, 0, 1975); +my $max_nice_time = timegm(0, 0, 0, 1, 0, 2030); %units = (); %pref = ( default => 1 ); @@ -109,7 +109,7 @@ sub construct { warn "Timezones not supported. Assuming GMT.\n"; } - my $timestamp = timegm($s, $m, $h, $d, $M, $y-1900); + my $timestamp = timegm($s, $m, $h, $d, $M, $y); die "Date '$args' is out of range" if $timestamp == -1; return [ $timestamp, { 'timestamp' => 1 } ]; }