From: Paul Battley Date: 2006-10-25T21:59:22+09:00 Subject: Re: Reopening Classes On 25/10/06, anthony.green@bbc.co.uk wrote: > > Can someone offer an explaination as to what I'm encountering here.. Range#each employs <=>, so by changing the semantics of the comparison, you break your step loop. When you redefine <=> after the loop, it doesn't affect it, so your second example works. Instead of altering Time, you could just do this: time_slots.sort_by{ |ts| ts.strftime("%H%M%S%Y%m%d").to_i } Paul.