Bug in time module?

lec englim at pc.jaring.my
Wed Sep 8 00:13:20 EDT 1999


Is this considered a bug since there is no Feb 31, 1999 or Feb 29, 1999?

>>> import time
>>> time.strptime('31/02/1999', "%d/%m/%Y")
(1999, 2, 31, 0, 0, 0, 2, 62, 0)
>>> time.asctime(time.strptime('31/02/1999', "%d/%m/%Y"))
'Wed Feb 31 00:00:00 1999'
>>> time.strptime('29/02/1999', "%d/%m/%Y")
(1999, 2, 29, 0, 0, 0, 0, 60, 0)
>>> time.asctime(time.strptime('29/02/1999', "%d/%m/%Y"))
'Mon Feb 29 00:00:00 1999'





More information about the Python-list mailing list