我用的是:
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)
Run Code Online (Sandbox Code Playgroud)
存储时间长度.
但是当我有:
total_time_text ="26h 50m"
Run Code Online (Sandbox Code Playgroud)
我得到一个例外
'hour must be in 0..23'
Run Code Online (Sandbox Code Playgroud)
所以类型"时间"不适合这个var.我必须使用什么?
归档时间: |
|
查看次数: |
1666 次 |
最近记录: |