[issue15873] "datetime" cannot parse ISO 8601 dates and times
Alexander Belopolsky
report at bugs.python.org
Sun Sep 9 18:11:01 CEST 2012
Alexander Belopolsky added the comment:
> I realize that while that is certainly an absolute lower bound,
> it's almost certainly not sufficient. The most common use case
> I see on a daily basis is parsing strings that look like
> "2012-09-07T23:59:59+00:00".
This is exactly what isoformat() of an aware datetime looks like:
>>> datetime.now(timezone.utc).isoformat()
'2012-09-09T16:09:46.165886+00:00'
str() is the same up to T replaced by space:
>>> print(datetime.now(timezone.utc))
2012-09-09 15:19:12.567692+00:00
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15873>
_______________________________________
More information about the Python-bugs-list
mailing list