method
<=>
<=>(p1)
public
Comparison—Compares time with other_time.
-1, 0, +1 or nil depending on whether time is less than, equal to, or greater than other_time.
nil is returned if the two values are incomparable.
t = Time.now #=> 2007-11-19 08:12:12 -0600 t2 = t + 2592000 #=> 2007-12-19 08:12:12 -0600 t <=> t2 #=> -1 t2 <=> t #=> 1 t = Time.now #=> 2007-11-19 08:13:38 -0600 t2 = t + 0.1 #=> 2007-11-19 08:13:38 -0600 t.nsec #=> 98222999 t2.nsec #=> 198222999 t <=> t2 #=> -1 t2 <=> t #=> 1 t <=> t #=> 0