From: Paul Date: 2007-03-20T23:15:09+09:00 Subject: Re: Sorting Dates and Times in an array Thanks to everyone for your info and feedback. I wanted to avoid any additional 'require' statements in the script so I reviewed the 'Time' class some more. After having reviewed all of the solutions, I came up with my own that seems to work for both the date and time fields: > @date_array.sort! {|a,b| Time.parse( b[ 0 ] ) <=> Time.parse( a[ 0 ] ) } # i.e. descending sort by date Given that I am manipulating an array of arrays that may not really get to be more than 1,000 lines, I think this will work well enough for now. I would not have been able to figure it out if I hadn't had all of your solutions to review and compare. Thanks again. Cheers! Paul. On Mar 20, 8:26 am, Robert Klemme wrote: > > Maybe it's the version? > > 13:25:57 [~]: irb > irb(main):002:0> require 'date' > => true > irb(main):003:0> Date.new 0 > => # > irb(main):004:0> RUBY_VERSION > => "1.8.5" > irb(main):005:0> > > Kind regards > > robert