Open this example in the interactive library
Source code
from datetime import datetime
print(datetime.strptime('22/10/2026', '%d/%m/%Y').date())Sample output
2026-10-22

Parse a formatted date. A self-contained example using the Python standard library.
Open this example in the interactive library
from datetime import datetime
print(datetime.strptime('22/10/2026', '%d/%m/%Y').date())2026-10-22