InfiniteLoop has asked for the wisdom of the Perl Monks concerning the following question:
printsperl -e ' use Time::Piece; $end_date = Time::Piece->strptime("31-02-2006", "%d-%m-%Y"); print $end_date;'
I expected Time::Piece to throw an error because there are only 28 days in Feb 2006, however the date is being parsed. Is there a way in which I can have the TIme::Piece throw an error for the above condition ?Fri Mar 3 00:00:00 2006
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Time::Piece strangeness
by davidrw (Prior) on Nov 17, 2005 at 19:02 UTC | |
|
Re: Time::Piece strangeness
by randyk (Parson) on Nov 17, 2005 at 21:54 UTC | |
|
an alternative with DateTime
by mojotoad (Monsignor) on Nov 18, 2005 at 05:10 UTC | |
|
Re: Time::Piece strangeness
by ww (Archbishop) on Nov 17, 2005 at 17:55 UTC | |
by davidrw (Prior) on Nov 17, 2005 at 19:08 UTC |