第1个回答 推荐于2016-10-13
先把时间格式“1:23:20:27.00” 转化为字符串
s1="1:23:20:27.00"
#a=time.strptime(s1,'%d:%H:%m:%S')
print s1.replace(':','').replace('.','')
#print s1.split(':')
do = {0:24*60*60,1:60*60,2:60,3:1}
ls2=[i for i in s1.split(':')]
print sum([ int(float(i)) * do[ls2.index(i)] for i in ls2])
>>> ================================ RESTART ================================
>>>
123202700
170427
>>>本回答被提问者采纳