Skip to content

Instantly share code, notes, and snippets.

@jgrau
Created May 6, 2011 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgrau/959953 to your computer and use it in GitHub Desktop.
Save jgrau/959953 to your computer and use it in GitHub Desktop.
sum = 0
"23:34:02".split(":").each_with_index do |n, i|
case i
when 0
sum = sum+n.to_i*60*60
when 1
sum = sum+n.to_i*60
when 2
sum = sum+n.to_i
end
end
Time.now + sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment