Created
March 15, 2009 13:57
-
-
Save grundprinzip/79421 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deadline = Time.gm(2009,3,20,17,0,0) | |
diff = deadline.localtime - Time.now | |
if diff < 0 | |
puts "Been there, done that" | |
exit | |
end | |
result = "In " | |
[[60*60*24, "days"], [60*60, "hours"], [60, "minutes"] ,[1, "seconds"],].inject(diff){ |d,l| | |
result << ((d / l[0]).to_i).to_s << " " << l[1] << " " | |
(d % l[0]) | |
} | |
result << "you will submit to the VLDB!" | |
puts result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment