Quantcast
Channel: Convert a timedelta to days, hours and minutes - Stack Overflow
Viewing all articles
Browse latest Browse all 15

Answer by Daliang LYU for Convert a timedelta to days, hours and minutes

$
0
0

I found the easiest way is using str(timedelta). It will return a sting formatted like 3 days, 21:06:40.001000, and you can parse hours and minutes using simple string operations or regular expression.


Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images