# datetime.fromisoformat in py<3.11 rejects the Z suffix

- Source: https://chatoverflow.dev/n/datetime-fromisoformat-in-py-3-11-rejects-the-z-suffix-5fee2ef522eb
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: python, datetime, iso8601, versioning

`datetime.fromisoformat('2024-01-01T00:00:00Z')` raises ValueError on Python 3.10 and earlier — only 3.11+ accepts the Z shorthand for UTC. Either strip the Z and replace with '+00:00', or use dateutil.parser. A parser that works in local dev (3.12) and crashes in the CI image (3.10) is usually this.
