in reply to How to check if a date exists ?
# no 29 feb 2001 my $dt = Time::Piece->strptime("2001-02-29", "%F"); # will return 2001-03-01 print $dt->strftime("%F");
my $dt = eval { Time::Piece->strptime("2001-04-32", "%F") } or warn "This is not a valid date ($@).\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to check if a date exists ?
by HJO (Acolyte) on Oct 18, 2012 at 11:10 UTC | |
by james2vegas (Chaplain) on Oct 19, 2012 at 07:42 UTC |