Flowdock
<=>(p1) public

Comparison—Compares time with other_time.

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
Show source
Register or log in to add new notes.