Skip to content

Support parsing invalid date strings #110648

@yfa-vagelis

Description

@yfa-vagelis

I don't know if this is already discussed, but I want to parse some date strings, but they are not always valid (e.g. 30 Feb 2023).

When I try to use the datetime.strptime I get an error, which is raised not because there is a problem with parsing the string, but because the parsed fields (i.e day, month, year) cannot create a valid datetime object.

Is it possible to get the parsed fields anyway?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions