什么类型在python中存储时间长度? [英] What type to store time length in python?
本文介绍了什么类型在python中存储时间长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用:
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"
我得到一个例外
'hour must be in 0..23'
,因此该时间类型不适用于类型时间".我必须使用什么?
so the type "time" is not properly for this var. What I must to use?
推荐答案
这篇关于什么类型在python中存储时间长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文