schon wieder eine Frage, aber nur ne kleine zum Verständnis.
In der Doku steht bei strftime:
%S - Second of the minute (00..60)
wenn ich nun das folgende ausführe:
Code: Alles auswählen
import time
time_format = "%H:%M:%S"
print time.strptime("23:59:61", time_format)
print time.strptime("23:59:62", time_format)
time.struct_time(tm_year=1900, tm_mon=1, tm_mday=1, tm_hour=23, tm_min=59, tm_sec=61, tm_wday=0, tm_yday=1, tm_isdst=-1)
Traceback (most recent call last):
File "tf.py", line 5, in <module>
print time.strptime("23:59:62", time_format)
File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.6/_strptime.py", line 328, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: 2
das heißt die 61 Sekunden werden noch geschluckt, bei 62 gehts schief.
Ich verstehe aber schon die 60 Sekunden nicht, Das wäre doch einfach 1 Minute mehr (und 0 Sekunden).
Und wozu die 61 Sekunden?
Kann mir das jemand erklären?
Danke
Bernhard