我正在使用:
total_time=datetime.time(int(total_time_text.replace("h","").replace("m","").split(" ")[0]),int(total_time_text.replace("h","").replace("m","").split(" ")[1]),0)
存储时间长度。
但是当我有:
total_time_text ="26h 50m"
我得到一个异常(exception)
'hour must be in 0..23'
所以“时间”类型不适合这个变量。我必须使用什么?
最佳答案
关于python - 在python中存储时间长度的类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6580168/