Skip to content

Instantly share code, notes, and snippets.

@rschenk
Created January 12, 2012 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rschenk/1602334 to your computer and use it in GitHub Desktop.
Save rschenk/1602334 to your computer and use it in GitHub Desktop.
require 'date'
d1 = Date.parse('Apr 1, 2011')
d2 = Date.parse('Feb 1, 2011')
if d2 > d1
p "#{d2} comes before #{d1}"
elsif d1 > d2
p "#{d1} comes before #{d2}"
else
p "#{d1} and #{d2} are the same"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment