[issue45884] datetime.strptime incorrectly handling hours and minutes with bad format string

2021-11-26 Thread Jon Oxtoby
Jon Oxtoby added the comment: I was indeed overlooking the note in the documentation that the leading zero is optional for some formatters when using strptime. Closing. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue45884] datetime.strptime incorrectly handling hours and minutes with bad format string

2021-11-23 Thread Jon Oxtoby
Jon Oxtoby added the comment: Just noticed the potential for this issue was raised in https://bugs.python.org/msg393688 so it's possible this is not a bug and is the desired behavior, but the documentation doesn't seem to address the issue (unless I'm overlooking

[issue45884] datetime.strptime incorrectly handling hours and minutes with bad format string

2021-11-23 Thread Jon Oxtoby
New submission from Jon Oxtoby : Running datetime.strptime against a string containing year, month, day but with a formatter including %H causes a two-digit day to be split across the day and hour fields of the datetime: datetime.datetime.strptime('20140812', '%Y%m%d%H') returns