Skip to content

Instantly share code, notes, and snippets.

@peijiehu
Last active August 29, 2015 14:04
Show Gist options
  • Save peijiehu/b3c911f3012eb5b6bf19 to your computer and use it in GitHub Desktop.
Save peijiehu/b3c911f3012eb5b6bf19 to your computer and use it in GitHub Desktop.
Ruby: Convert seconds to H:M:S format
time = 12345678 # seconds
formatted_time = Time.at(time).utc.strftime("%H:%M:%S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment