Skip to content

Instantly share code, notes, and snippets.

@tetra5
Last active December 14, 2015 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetra5/5089076 to your computer and use it in GitHub Desktop.
Save tetra5/5089076 to your computer and use it in GitHub Desktop.
Convert seconds to h:m:s with divmod
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
print "%d:%02d:%02d" % (hours, minutes, seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment