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.