From: Daniel Sheppard Date: 2007-10-15T16:33:45+09:00 Subject: Re: "reversing" a Time > is it possible to reverse order when using a Time as sort key > for sort_by? > > I know I could use sort, and time2 <=> time1, but it's getting > complicated when the sort key is compound, like > > sort_by{|e| [e.name, e.time]} For your special case of using time as a sort key, just convert the time to an integer sort_by {|e| [e.name, -e.time.to_i] } Dan.