bpo-37962: Improve ISO 8601 timezone support in the datetime.fromisoformat() method (GH-15547) by zeth · Pull Request #15547 · python/cpython

Makes the datetime.fromisoformat() method more conformant with ISO 8601.

Namely, section 4.2.5.1: "When it is required to indicate the difference between local time and UTC of day, the representation of the difference can be expressed in hours and minutes, or hours only."

And Section 4.2.4, UTC shall be expressed "by the UTC designator [Z]".

A key use case of the latter is being able to parse JavaScript Date objects (e.g. dates that have come from a web frontend or a JSON document). This considerably improves the usefulness of the datetime.fromisoformat method.

https://bugs.python.org/issue37962