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 martin.panter
Recipients Alexander.Belopolsky, Anders.Hovmöller, Arfrever, barry, belopolsky, berker.peksag, cvrebert, davydov, deronnax, eric.araujo, flying sheep, jcea, jstasiak, jwilk, karlcow, kirpit, martin.panter, mcepl, mihaic, nagle, pbryan, perey, piotr.dobrogost, r.david.murray, roysmith, vstinner
Date 2016-02-16.03:23:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455593009.56.0.910690532139.issue15873@psf.upfronthosting.co.za>
In-reply-to
Content
It looks to me like you copied a lot of code, doc strings, tests, etc from <https://github.com/django/django/commit/9b1cb75#diff-4db1d116f25f482278090b122e3b0028> and <https://github.com/django/django/commit/2f59e94>. I wouldn’t call it trivial. There is a BSD license for Django. Or do we have to get the relevant authors to do the Python CLA thing?

The current patch seems to allow a timezone without a colon, or even without minutes (+1100 and +11 as well as the RFC’s +11:00). Is this needed? The colon was made optional in Django in <https://code.djangoproject.com/ticket/18728>; the argument given for this just seems to be ISO 8601 alignment, nothing practical. According to <https://code.djangoproject.com/ticket/22814> Postgre SQL outputs time zones without the minutes field, but I don’t know if Python should go out of its way to support this obscure format.

RFC 3339 does not specify single digits in many places (e.g. 2016-2-1 1:0:0 is not specified). Should we also be stricter, at least for the minutes and seconds fields?

Also, is it necessary to allow the seconds field to be omitted, as in "2016-02-01 01:21"?

It seems that the “datetime” module does not support leap seconds, so if we mention RFC 3339 we should point out this inconsistency.

Victor: From my limited experiments, datetime.fromtimestamp() seems to use the round-to-even rule (not always rounding half up). Can you confirm? Maybe we should use that for consistency if it is practical. Otherwise, truncation towards zero would be the simplest.

As well as adding datetime.fromisoformat(), I think we should add similar methods to the separate date and time classes. One can parse the RFC’s full-date format fairly easily with strptime(), but not so for partial-time because of the fractional seconds.
History
Date User Action Args
2016-02-16 03:23:30martin.pantersetrecipients: + martin.panter, barry, jcea, roysmith, belopolsky, nagle, vstinner, jwilk, mcepl, eric.araujo, Arfrever, r.david.murray, davydov, cvrebert, karlcow, Alexander.Belopolsky, perey, flying sheep, mihaic, berker.peksag, piotr.dobrogost, kirpit, Anders.Hovmöller, jstasiak, deronnax, pbryan
2016-02-16 03:23:29martin.pantersetmessageid: <1455593009.56.0.910690532139.issue15873@psf.upfronthosting.co.za>
2016-02-16 03:23:29martin.panterlinkissue15873 messages
2016-02-16 03:23:27martin.pantercreate