Skip to content

Instantly share code, notes, and snippets.

@brookemckim
Created August 15, 2011 20:54
Show Gist options
  • Save brookemckim/1147839 to your computer and use it in GitHub Desktop.
Save brookemckim/1147839 to your computer and use it in GitHub Desktop.
duration_as_hhmm
def duration_as_hhmm
seconds = adjusted_duration
hours = (seconds / 3600).to_i
minutes = (seconds - (hours * 3600)) / 60
# hhmm
"#{'%02d' % hours}#{'%02d' % minutes % 60}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment