Пользуюсь следующей инструкцией для превращения времени в секунды:
time.mktime(time.strptime('21:11:2008 ' + line[57:76].strip(), "%d:%m:%Y %H:%M'%S"))-time.mktime(time.strptime('21:11:2008 00:00:00', "%d:%m:%Y %H:%M:%S"))
time.mktime(time.strptime('21:11:2008 ' + line[57:76].strip(), "%d:%m:%Y %H:%M'%S"))-time.mktime(time.strptime('21:11:2008 00:00:00', "%d:%m:%Y %H:%M:%S"))
from datetime import timedelta
s=timedelta(0, seconds, 0, 0, minutes, hours)
s.seconds
>>> import datetime
>>> d = datetime.datetime.strptime('12.02.2008-10:15:01', '%d.%m.%Y-%H:%M:%S')
>>> d
datetime.datetime(2008, 2, 12, 10, 15, 1)