Author bkaznowski
Recipients bkaznowski
Date 2021-07-12.15:23:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When you convert a date pre the year 1000 to a string with `%Y` as the formatter and then back to a date again then it fails. This is because `%Y` expects it to be formatted with leading zeroes. For example, the year 1/01/01 (yyyy/mm/dd) should be 0001/01/01 when formatting using %Y/%m/%d. However, %Y returns 1.
You can see this in action here:

from datetime import date, datetime
format = "%Y-%m-%d"
formatted = date.min.strftime("%Y-%m-%d")
datetime.strptime(formatted, format).date()

`ValueError: time data '1-01-01' does not match format '%Y-%m-%d'` is raised on the forth line.
Date User Action Args
2021-07-12 15:23:50bkaznowskisetrecipients: + bkaznowski
2021-07-12 15:23:50bkaznowskisetmessageid: <>
2021-07-12 15:23:50bkaznowskilinkissue44610 messages
2021-07-12 15:23:50bkaznowskicreate