Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2つのアクション間の時間差(diff)を人間が読める時間に変換する必要があります。
Pythonでこれを行うにはどうすればよいですか?私は次のようなことを試みました
diff = 49503757 datetime.time(0,0,0,diff)
しかし、diff値が長すぎたため、日時は0〜999999のマイクロ秒の値を想定しており、この例のdiffは49503757でした。
>>> from datetime import timedelta >>> str(timedelta(microseconds=49503757)) '0:00:49.503757'