1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| >>> from time import strptime
>>> print strptime('05/64/08','%d/%m/%y')
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
print strptime('05/64/08','%d/%m/%y')
File "C:\Python25\lib\_strptime.py", line 330, in strptime
(data_string, format))
ValueError: time data did not match format: data=05/64/08 fmt=%d/%m/%y
>>> print strptime('30/02/08','%d/%m/%y')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
print strptime('30/02/08','%d/%m/%y')
File "C:\Python25\lib\_strptime.py", line 440, in strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
>>> print strptime('29/02/08','%d/%m/%y')
(2008, 2, 29, 0, 0, 0, 4, 60, -1)
>>> print strptime('30/02/09','%d/%m/%y')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
print strptime('30/02/09','%d/%m/%y')
File "C:\Python25\lib\_strptime.py", line 440, in strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
>>> print strptime('29/02/09','%d/%m/%y')
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
print strptime('29/02/09','%d/%m/%y')
File "C:\Python25\lib\_strptime.py", line 440, in strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
>>> print strptime('28/02/09','%d/%m/%y')
(2009, 2, 28, 0, 0, 0, 5, 59, -1)
>>> |
Partager