Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-Format-Strptime CPAN distribution.

Report information
The Basics
Id: 25555
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: rickm [...] cpan.org
Requestors: dan.horne [...] redbone.co.nz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.0700
Fixed in: (no value)



Subject: Module dies even when on_error is 'undef'
Hi, I'm having errors with invalid dates causing the parse to die instead of failing silently: use DateTime::Format::Strptime; my $strp = new DateTime::Format::Strptime(pattern => '%Y-%m-%d %H:%M:%S', on_error=> 'undef'); my $date = '0000-00-00 00:00:00'; my $dt = $strp->parse_datetime($date) || print $strp->errmsg; This dies with: The 'month' parameter ("00") to DateTime::new did not pass the 'is between 1 and 12' callback at /usr/local/lib/perl5/site_perl/5.8.7/DateTime/Format/Strptime.pm line 444 The way that D::F::S handles incorrect dates is not consistent. E.g. replace the date line with my $date = '1999-111-12 02:30:16'; And the code performs as expected, $strp->errmsg returns: "24 is too large to be a month of the year."
This was fixed in 1.0800. In future, please log bugs in the google-code project: http://code.google.com/p/datetime-format-strptime/