Skip to content

Instantly share code, notes, and snippets.

@djaiss
Created January 4, 2015 18:22
Show Gist options
  • Select an option

  • Save djaiss/e14b8b70dcb89c6e016b to your computer and use it in GitHub Desktop.

Select an option

Save djaiss/e14b8b70dcb89c6e016b to your computer and use it in GitHub Desktop.
Differences between dates from the command line
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