[issue15873] datetime: add ability to parse RFC 3339 dates and times

Paul Ganssle report at bugs.python.org
Mon Dec 18 09:59:52 EST 2017


Paul Ganssle <p.ganssle at gmail.com> added the comment:

> Not if the time is associated with a particular day. Imagine implementing datetime.fromisoformat by separately calling date.fromisoformat and time.fromisoformat. The date will be off by one day if you naively rounded 2017-12-18 23:59 “up” to 2017-12-18 00:00.

Yes, I suppose this is a problem if you implement it that way. Seems like a somewhat moot point, but I think any decision about rounding should probably be driven by what people are expecting more than by how it is implemented.

That said, I can see a good case for truncation *and* rounding up for something like '2016-12-31T23:59:59.999999999'. Rounding up to '2017-01-01' is certainly the closest whole millisecond to round to, *but* often people expressing a "23:59:59.9999999" are trying to actually express "the last possible moment *before* 00:00".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15873>
_______________________________________


More information about the Python-bugs-list mailing list