This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zeth
Recipients zeth
Date 2019-08-27.12:07:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566907658.52.0.492553753506.issue37962@roundup.psfhosted.org>
In-reply-to
Content
The datetime.datetime.fromisoformat() method unnecessarily rejects datetime strings that are valid under ISO 8601 if timezone uses the UTC  designator or it only has hours.

In ISO 8601, 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.
History
Date User Action Args
2019-08-27 12:07:38zethsetrecipients: + zeth
2019-08-27 12:07:38zethsetmessageid: <1566907658.52.0.492553753506.issue37962@roundup.psfhosted.org>
2019-08-27 12:07:38zethlinkissue37962 messages
2019-08-27 12:07:38zethcreate