Subject: | %D mis-handles 4 digits years. |
Giving a 4 digit year and the %D format, a wrong date will be returned instead of throwing an error. The following test script illustrates this. The date starts out in 2005, but is transformed into the year "2020".
use Test::More qw/no_plan/;
use strict;
use DateTime::Format::Strptime;
my $Strp = new DateTime::Format::Strptime( pattern => '%D');
my $dt;
eval { $dt = $Strp->parse_datetime('12/15/2005'); };
ok($@,"a 4 digit year with %D should throw an error ") || diag $dt->mdy('/');