Dual-Life / Time-Piece

Object Oriented time objects
Other
15 stars 33 forks source link

strptime() succeeding on invalid input #53

Open x-qq opened 3 years ago

x-qq commented 3 years ago

Current behavior:

% perl -E 'use strict; use warnings; use Time::Piece; for my $input (qw[2020 2020- 2020-11]) { say Time::Piece->strptime($input, "%Y-%m-%d")->ymd }'                                                                                                                                    
2020-01-01
2020-01-01
2020-11-01
%

Expected behavior: unless I am missing something, all three of these should raise an exception due to mismatch between format string and provided value.

Environment: Module version: 1.3401 Perl: 5.26.2 OS: Debian GNU/Linux Unstable amd64