[issue1100942] Add datetime.time.strptime and datetime.date.strptime

Alexander Belopolsky report at bugs.python.org
Tue Apr 20 18:02:19 CEST 2010


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

I am +1 for adding these features and I have only one comment on the code:

It is documented in time.strptime() documentation that
"""
The default values used to fill in any missing data when more accurate values cannot be inferred are (1900, 1, 1, 0, 0, 0, 0, 1, -1). 
""" http://docs.python.org/dev/py3k/library/time.html#time.strptime

and "datetime.strptime(date_string, format) is equivalent to datetime(*(time.strptime(date_string, format)[0:6]))." according to datetime module documentation.

Thus, datetime.strptime("", "") returning datetime.datetime(1900, 1, 1, 0, 0) is not an implementation detail and there is no need to compute it in time_strptime.

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

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


More information about the Python-bugs-list mailing list