Skip to content

Instantly share code, notes, and snippets.

View scott2b's full-sized avatar

Scott Bradley scott2b

  • Northwestern University
  • Evanston
View GitHub Profile
#!/usr/bin/ruby
require 'time'
def format_time(seconds)
hours = (seconds / 3600).to_i
minutes = ((seconds % 3600) / 60).to_i
seconds = (seconds % 60).to_i
minutes = "0#{minutes}" if minutes < 10
seconds = "0#{seconds}" if seconds < 10