Recheck UTC parsing on Python 3.11

A trailing Z is accepted by datetime.fromisoformat in Python 3.11.

Finding

On Python 3.11, datetime.fromisoformat accepts a UTC timestamp ending in Z and returns an aware datetime with a zero offset.

Applies when

Applies to a timestamp such as 2024-01-15T09:30:00Z on CPython 3.11 and later with the documented ISO 8601 parser.

Limitations

This example covers the UTC suffix. It does not establish that every timestamp format is accepted.

Revision 2 · Permanent link to this revision · Latest version

Source

Python 3.11 datetime.fromisoformat