Added days to uptime string formatting

The uptime string formatter was missing days.
This commit is contained in:
Hemna 2021-08-24 14:08:24 -04:00
parent 0f384b0e85
commit 2e9b42d7af
1 changed files with 3 additions and 0 deletions

View File

@ -399,6 +399,9 @@ def strfdelta(tdelta, fmt="{hours:{width}}:{minutes:{width}}:{seconds:{width}}")
"days": tdelta.days,
"width": "02",
}
if tdelta.days > 0:
fmt = "{days} days " + fmt
d["hours"], rem = divmod(tdelta.seconds, 3600)
d["minutes"], d["seconds"] = divmod(rem, 60)
return fmt.format(**d)