Created
January 4, 2015 18:22
-
-
Save djaiss/e14b8b70dcb89c6e016b to your computer and use it in GitHub Desktop.
Differences between dates from the command line
This file contains 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
require 'date' | |
t = Time.now | |
endDate = Date.new(t.year, t.month, t.day) | |
startDate = Date.new(2011, 11, 22) | |
days = endDate - startDate | |
puts days.to_i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment