Format seconds with :02
This commit is contained in:
parent
281b7286d6
commit
a985c962fe
1 changed files with 3 additions and 3 deletions
|
@ -49,9 +49,9 @@ def format_duration(total_seconds):
|
||||||
days, hours = divmod(total_hours, 24)
|
days, hours = divmod(total_hours, 24)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
"{days} days, {hours:02}:{minutes:02}:{seconds}" if days > 0 else
|
"{days} days, {hours:02}:{minutes:02}:{seconds:02}" if days > 0 else
|
||||||
"{hours}:{minutes:02}:{seconds}" if hours > 0 else
|
"{hours}:{minutes:02}:{seconds:02}" if hours > 0 else
|
||||||
"{minutes}:{seconds}"
|
"{minutes}:{seconds:02}"
|
||||||
).format(days=days, hours=hours, minutes=minutes, seconds=seconds)
|
).format(days=days, hours=hours, minutes=minutes, seconds=seconds)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue