PyDocs

Nav

Data Types

date.fromisoformat

datetime

classmethod of date · Added in 3.7
  • date.fromisoformat(date_string)
Construct a date from a string in ISO 8601 format.
Changed in 3.11
  • 3.11: Previously, this method only supported the format YYYY-MM-DD.
1 Example
>>> import datetime as dt
>>> dt.date.fromisoformat('2019-12-04')
datetime.date(2019, 12, 4)
>>> dt.date.fromisoformat('20191204')
datetime.date(2019, 12, 4)
>>> dt.date.fromisoformat('2021-W01-1')
datetime.date(2021, 1, 4)
from the Python docs
See Also
No see-alsos for datetime/date.fromisoformat
0 Notes
No notes for date.fromisoformat