Alexander Belopolsky added the comment:
> For any valid string, strptime followed by strftime should return
> the same string.
Not necessarily. String to datetime mapping implemented by strptime can be
many to one. For example,
>>> datetime.strptime("2014 366", "%Y %j") == datetime.strptime("2015 1", "%Y
>>> %j")
True
in this case, strptime-strftime may not round-trip.
>>> datetime.strptime("2014 366", "%Y %j").strftime("%Y %j")
'2015 001'
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23136>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com