What is the best way to compare the dates of two Time objects in Ruby?
I have two objects, for example:
time_1 = Time.new(2012,12,10,10,10) time_2 = Time.new(2012,12,11,10,10)
In this example, date comparison should return false.
Otherwise, the same date, but at different times, should return true:
time_1 = Time.new(2012,12,10,10,10) time_2 = Time.new(2012,12,10,11,10)
I tried using .to_date , which works for DateTime objects but is not supported by Time .
source share