In the format I am given, the date 2014-01-02 would be represented by "20140102". This is correctly parsed with the standard strptime:
>>> datetime.datetime.strptime("20140102", "%Y%m%d")
datetime.datetime(2014, 1, 2, 0, 0)
In this format, "201412" would not be a valid date. The docs say that the "%m" directive is "Month as a zero-padded decimal number." It gives as examples "01, 02, ..., 12". The days directive "%d" is also supposed to be zero-padded.
Based on this, I expected that "201412" would be an invalid input with this format, so would raise a ValueError. Instead, it is interpreted as 2014-01-02:
>>> datetime.datetime.strptime("201412", "%Y%m%d")
datetime.datetime(2014, 1, 2, 0, 0)
The question is: is there a way to specify "no seriously zero-padded only"? Or am I misunderstanding the term "zero-padded" in this context?
Note that the question is not about how to parse dates in this format, but about understanding the behavior of strptime.