Subject: | strptime returns negative month for certain inputs |
Date: | Sat, 28 Jul 2018 13:12:56 -0700 |
To: | bug-TimeDate [...] rt.cpan.org |
From: | Jim Avera <jim.avera [...] gmail.com> |
Hello,
Date::Parse::strptime("199001") returns -1 for the month. This looks
like a bug, as the docs say undef should be returned for missing fields
(or an empty list if the input is not valid).
Actually I was hoping that it would recognize YYYYMM as a partial date
(with day omitted).
In any case, negative results don't seem right.
Date::Parse Version 2.30
Perl v5.26
perl -MDate::Parse -MData::Dumper -wE 'my @a=strptime("199001"); say
Dumper(@a);'
$VAR1 = undef;
$VAR2 = undef;
$VAR3 = undef;
$VAR4 = '1';
$VAR5 = -1;
$VAR6 = 90;
$VAR7 = undef;