atoomic / perl-TimeDate

time & date parsing and formatting perl library
http://search.cpan.org/dist/TimeDate/
1 stars 3 forks source link

strptime not parsing ISO-8601 format correctly #44

Open uporersith opened 2 years ago

uporersith commented 2 years ago

using the example code: `use Date::Parse;

my $date="2015-01-01T08:51:00"; my @ta = strptime($date);

print "input:$date\n"; print "output:@ta\n";`

the output is: $perl date_test.pl input:2015-01-01T08:51:00 output:00 51 08 01 0 115 20

I'm expecting the output to show:

output:00 51 08 01 01 2015

uporersith commented 2 years ago

I also attempted the example from https://metacpan.org/pod/Date::Parse

example: 1995-01-24T09:08:17.1823213

my output is output:17.1823213 08 09 24 0 95 19

the error appears here too, it looks like the month '01' is getting mis-parsed

so I guess for my example. I should be getting 00 51 08 01 01 15 20.