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)
|
||||
|
||||
return (
|
||||
"{days} days, {hours:02}:{minutes:02}:{seconds}" if days > 0 else
|
||||
"{hours}:{minutes:02}:{seconds}" if hours > 0 else
|
||||
"{minutes}:{seconds}"
|
||||
"{days} days, {hours:02}:{minutes:02}:{seconds:02}" if days > 0 else
|
||||
"{hours}:{minutes:02}:{seconds:02}" if hours > 0 else
|
||||
"{minutes}:{seconds:02}"
|
||||
).format(days=days, hours=hours, minutes=minutes, seconds=seconds)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue