Skip to content

strptime() succeeding on invalid input #53

Description

@x-qq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions