From: Brian Candler Date: 2008-10-30T18:14:20+09:00 Subject: Re: Sorting Array Of Dates Chandu Chandu wrote: > i have array > > date = ['12/09/2007','06/06/2004','10/06/2005'] > > i wanted to sort dates in ascending order i.e > ['06/06/2004','10/06/2005','12/09/2007'] Apart from the other solutions mentioned, you could also just use ISO dates instead: date = ['2007-09-12','2004-06-06','2005-06-10'] http://en.wikipedia.org/wiki/ISO_8601#Calendar_dates As well as sorting natively, this also has the advantage of being absolutely clear which part is the month and which is the day. (In your example, I can't tell whether you are using American middle-endian dates or not) Regards, Brian. -- Posted via http://www.ruby-forum.com/.