Skip to content

Instantly share code, notes, and snippets.

@zhengnan110
Forked from gotgithub/countdown.rb
Created July 31, 2017 07:12
Show Gist options
  • Save zhengnan110/112d6a389e13b5e06a4f22f23aba4faa to your computer and use it in GitHub Desktop.
Save zhengnan110/112d6a389e13b5e06a4f22f23aba4faa 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment