This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author laurent chriqui
Recipients laurent chriqui
Date 2020-06-08.10:00:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591610433.59.0.264285389277.issue40908@roundup.psfhosted.org>
In-reply-to
Content
When you use strftime with a 2 digit year i.e. '32' it outputs a '32' instead of '0032'. 

This prevents parsing the string again with the same format through strftime.

Exemple:
import datetime

datetime_format="%Y"
date=datetime.date(32,1,1)
date_str=datetime.datetime.strftime(date, datetime_format)
datetime.datetime.strptime(date_str, datetime_format)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '32' does not match format '%Y'
History
Date User Action Args
2020-06-08 10:00:33laurent chriquisetrecipients: + laurent chriqui
2020-06-08 10:00:33laurent chriquisetmessageid: <1591610433.59.0.264285389277.issue40908@roundup.psfhosted.org>
2020-06-08 10:00:33laurent chriquilinkissue40908 messages
2020-06-08 10:00:33laurent chriquicreate