Skip to content

Instantly share code, notes, and snippets.

@waitkafuka
Forked from gotgithub/countdown.rb
Created December 6, 2016 07:35
Show Gist options
  • Save waitkafuka/c83f336b6db8d369f01473ab86b61346 to your computer and use it in GitHub Desktop.
Save waitkafuka/c83f336b6db8d369f01473ab86b61346 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