ID EN
Datetime

strptime

Python 3.11

Return a datetime corresponding to date_string, parsed according to format.

Syntax

PYTHON
classmethod datetime.strptime(date_string, format)

Examples

Example 1
PYTHON
datetime(*(time.strptime(date_string, format)[0:6]))

See Also

datetime ValueError time.strptime() strftime() and strptime() Behavior datetime.fromisoformat()