Skip to main content

parse_date

Parse a string and return a datetime.date.

Raise ValueError if the input is well formatted but not a valid date.
Return None if the input isn't well formatted.
def parse_date(
value: string
) - > datetime.date

Parse a string and return a datetime.date.

Parameters

NameTypeDescription
valuestringThe date string to be parsed, expected in ISO format or a format matching the internal date regular expression

Returns

TypeDescription
datetime.dateA date object representing the input string, or None if the input format is not recognized