[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker ___

[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread Eric V. Smith
Eric V. Smith added the comment: You have the parameters to strptime backward. >>> datetime.datetime.strptime(datetime.datetime.now().strftime("%c"), "%c") datetime.datetime(2020, 12, 16, 20, 51, 38) -- nosy: +eric.smith ___ Python tracker

[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread sds
New submission from sds : >>> import datetime, locale >>> locale.getlocale() ('en_US', 'UTF-8') >>> datetime.datetime.strptime("%c",datetime.datetime.now().strftime("%c")) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_d