I need to convert time value strings given in the following format to seconds, for example:
1.\'00:00:00,000\' -> 0 seconds 2.\'00:00:10,000\' -> 10 s
For Python 2.7:
>>> import datetime >>> import time >>> x = time.strptime('00:01:00,000'.split(',')[0],'%H:%M:%S') >>> datetime.timedelta(hours=x.tm_hour,minutes=x.tm_min,seconds=x.tm_sec).total_seconds() 60.0