Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 58613
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: verymuch.happyman [...] gmail.com
Cc:
AdminCc:

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



Subject: ParseDate 0001 year Bug
Date: Wed, 23 Jun 2010 10:16:33 +0800
To: bug-Date-Manip [...] rt.cpan.org
From: verymuch.happyman [...] gmail.com
- Distribution name and version (Date-Manip-6.11) - Perl version (perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi) - Operating System vendor and version (Linux b-desktop 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686 GNU/Linux Work code: print UnixDate( ParseDate("12:00:00 1 January 0002"), "%Y-%m-%d %H:%M:%S" ),"\n"; Output: 0002-01-01 12:00:00 Bug code: print UnixDate( ParseDate("12:00:00 1 January 0001"), "%Y-%m-%d %H:%M:%S" ),"\n"; Output: Use of uninitialized value $y in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2225. Use of uninitialized value $y in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2226. Use of uninitialized value $m in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2228. Use of uninitialized value $d in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2229. Use of uninitialized value $h in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2230. Use of uninitialized value $mn in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2231. Use of uninitialized value $s in length at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2232. Use of uninitialized value $m in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2233. Use of uninitialized value $d in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2233. Use of uninitialized value $h in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2233. Use of uninitialized value $mn in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2233. Use of uninitialized value $s in concatenation (.) or string at /usr/local/share/perl/5.10.1/Date/Manip/Base.pm line 2233. Use of uninitialized value $beg in string comparison (cmp) at /usr/local/share/perl/5.10.1/Date/Manip/TZ.pm line 1069. Use of uninitialized value $end in string comparison (cmp) at /usr/local/share/perl/5.10.1/Date/Manip/TZ.pm line 1071. Use of uninitialized value $year in addition (+) at /usr/local/share/perl/5.10.1/Date/Manip/TZ.pm line 1072. "1 January 0001 12AM" also not parseable. With perl-DateManip-5.44-1.2.1 all working ok.
From the docs: ==== In one part of the code (calculating week-of-year values), Date::Manip references dates one week after and one week before the date actually being worked on. As such, the first week in the year 0001 fail (because a week before is in the year 1 BC), and the last week in the year 9999 fail (because a week later is in 10,000). No effort will be made to correct this because the added functionality is simply not that important (to me), especially since the Gregorian calendar doesn't really apply in either instance. To be absolutely safe, I will state that Date::Manip works as described in this manual during the period Feb 1, 0001 to Nov 30, 9999, and I will only support dates within that range (i.e. if you submit a bug using a date that is not in that range, I will will consider myself free to ignore it). === Your bug specifically deals with this, and as such, I am not interested in adding checks to correct this... the performance penalty (small as it would be) is not worth it to support the first week of 0001 and the last week of 9999, neither of which are actually valid dates in the Gregorian calendar.