Created
September 1, 2020 23:03
-
-
Save mtik00/d05f7fce0446904160168350a4297353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def format_timespan(seconds: float) -> str: | |
"""Formats the number of seconds in h:m:s""" | |
hours, seconds = divmod(seconds, 3600) | |
minutes, seconds = divmod(seconds, 60) | |
return f"{hours:d}h:{minutes:02d}m:{seconds}s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment