python - 在python中存储时间长度的类型是什么?

标签 python datetime

我正在使用:

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/

相关文章:

Python 多处理 : is it possible to have a pool inside of a pool?

Java Date - 闰年 - 奇怪的行为

Java 与 C++ 类型

python - Spark jdbc.write 到 mysql 并出现 null 错误

用于多条件异常处理的 Python 嵌套递归

mysql - 使用mysql重叠间隔

sql - Postgres : Get value of a column corresponding to max of other column in a group

c# - 从 DateTime 中删除 DST

python - != 和 <> 有什么区别?

Python:使用图表创建 Excel 工作表