Subject: | ParseDate returns false for some correct dates |
Date: | Mon, 14 Mar 2016 18:20:45 +0300 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Pronichev Alexander <dyker [...] agava.com> |
ParseDate returns false for some correct dates. For example:
1916-07-03
1930-06-21
1981-04-01
1982-04-01
1983-04-01
1984-04-01
dyker@dyker:~$ perl -v
This is perl 5, version 20, subversion 2 (v5.20.2) built for
x86_64-linux-gnu-thread-multi
(with 42 registered patches, see perl -V for more detail)
dyker@dyker:~$ perl -MDate::Manip -e 'warn Date::Manip->VERSION'
6.53 at -e line 1.
here is a script, how i found it:
#!/bin/perl
use strict;
use warnings;
use Date::Manip qw(ParseDate);
use POSIX qw(strftime);
my $now = time();
my $start = $now - 86400*365*100;
while ( $start < $now )
{
my $date = strftime("%Y-%m-%d", localtime($start));
print $date."\n" if !ParseDate( $date );
$start += 86400;
}