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
A little more pythonic way I think would be:
timestr = '00:04:23' ftr = [3600,60,1] sum([a*b for a,b in zip(ftr, map(int,timestr.split(':')))])
Output is 263Sec.
I would be interested to see if anyone could simplify it further.