I have a problem using the package DateTime::Format::Strptime.
Using the two following patterns :
pattern => '%B %d %Y %H:%M:%S' eg. 'Dec 16 2014 21:03:46'
pattern => '%B %d %H:%M:%S' eg. 'Sep 16 21:00:00'
The first pattern works, but not the second (which does not include the year neither in pattern neither in string).
Where could be the problem ?
Output is :#!/usr/bin/perl use DateTime::Format::Strptime; my $t = 'Dec 16 2014 21:03:46'; my $Strp = DateTime::Format::Strptime::->new( pattern => '%B %d %Y %H:%M:%S', locale => 'en_US', ); # my $dt = $Strp->parse_datetime($t); print "'$dt'\n"; my $t2 = 'Sep 16 21:00:00'; my $Strp2 = DateTime::Format::Strptime::->new( pattern => '%B %d %H:%M:%S', locale => 'eu_US', ); # my $dt2 = $Strp2->parse_datetime($t2); print "'$dt2'\n";
'2014-12-16T21:03:46' ''
In reply to about DateTime::Format::Strptime by bcostacurta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |