results: "Invalid day of month (day = 31 - month = 02)"#!/usr/bin/perl use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%d-%m-%Y', on_error => 'croak', ); my $dt = $strp->parse_datetime("31-02-2006"); print $dt->datetime, "\n";
You can assign any handler you want to 'on_error'
Cheers,
Matt
In reply to an alternative with DateTime
by mojotoad
in thread Time::Piece strangeness
by InfiniteLoop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |