如何来转换呢?请各位帮帮我
业精于勤,荒于嬉;行成于思,毁于随。
from datetime import datetime s = '152753' t = datetime.strptime(s, '%H%M%S').time() print(t) 15:27:53
s=str(152753) print s[0:2]+':'+s[2:4]+':'+s[4:6]
>>> time = "152753" >>> ':'.join(time[i:i+2] for i in range(0, len(time), 2)) >>> '15:27:53'
var time = '152753' time = time.substring(0,2)+':'+time.substring(2,4)+':'+time.substring(4,6)
业精于勤,荒于嬉;行成于思,毁于随。