I need to convert a time difference (diff) between two actions into a human readable time.
How can I do this with python? I tried something like
diff = 49503757
datetime.time(0,0,0,diff)
but the diff value was too long, the datetime expects a value of microseconds in between 0 and 999999 and my diff in this example was 49503757.
>>> from datetime import timedelta
>>> str(timedelta(microseconds=49503757))
'0:00:49.503757'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With