Skip to content

Instantly share code, notes, and snippets.

@gotgithub
Created September 8, 2011 07:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save gotgithub/1202870 to your computer and use it in GitHub Desktop.
Save gotgithub/1202870 to your computer and use it in GitHub Desktop.
Calculate the countdown for the meeting of the party.
#!/usr/bin/ruby
# Calculate the countdown for the meeting of the party.
require 'Date'
days=(DateTime.new(2012,10,15)-DateTime.now).ceil
if days >= 0
puts "Maybe #{days} days left."
else
puts "Passed for #{days.abs} days."
end
@LongyunZhang
Copy link

good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment