[issue15873] "datetime" cannot parse ISO 8601 dates and times

Alexander Belopolsky report at bugs.python.org
Fri Sep 7 01:08:29 CEST 2012


Alexander Belopolsky added the comment:

%z format is supported, but it cannot accept colon in TZ offset.  It can parse offsets like -0600 just fine.  What OP is looking for is the GNU date %:z format which datetime does not support. 

For ISO 8601 compliance, however I think we need a way to specify a parser that will accept any valid 8601 format: with T or space separator and with or without : in time and timezone and with or without dashes in date. 

I would very much like such promiscuous parser to be implemented in datetime.__new__.  So that we can create datetime objects from strings the way we do it with numbers.

----------
nosy: +Alexander.Belopolsky

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


More information about the Python-bugs-list mailing list