Skip to content

Instantly share code, notes, and snippets.

@hubertlepicki
Created February 27, 2014 06:25
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 hubertlepicki/9245365 to your computer and use it in GitHub Desktop.
Save hubertlepicki/9245365 to your computer and use it in GitHub Desktop.
convert number of seconds to hour:min:sec
def seconds_to_units(t)
mm, ss = t.divmod(60)
hh, mm = mm.divmod(60)
"#{hh}:#{mm}:#{ss}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment