Skip to content

Instantly share code, notes, and snippets.

@Alfreddd
Created October 2, 2011 10:03
Show Gist options
  • Save Alfreddd/1257301 to your computer and use it in GitHub Desktop.
Save Alfreddd/1257301 to your computer and use it in GitHub Desktop.
convert seconds to the form "10m 20s"
def convert_seconds_to_time(seconds)
total_minutes = seconds / 1.minutes
seconds_in_last_minute = seconds - total_minutes.minutes.seconds
"#{total_minutes}m #{seconds_in_last_minute}s"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment