--000e0cd151de819b8e0460ae56dd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit now ime.now yesterday w-1.day tomorrow w+1.day is_between rue if now > yesterday and now < tomorrow So.. you want to know if On Sat, Jan 17, 2009 at 8:32 AM, badboy <badboy / heartofgold.co.cc> wrote: > Cyrus Dev schrieb: > >> Hello all >> >> is there any direct comparison function in ruby or in rails for time >> >> I need a function which compare current time is between 2 time objects >> or not >> >> ... >> >> Please help me >> >> thanks in advance >> > my first solution would be to put the three time objects in an Array: > now ime.now > timebefore ow - 30*60*60 > timeafter ow + 30*60*60 > timearray now, timebefore, timeafter] > and after that using > timearray.sort > to sort them. If now is between the two dates if should be on position 1 > > > > --000e0cd151de819b8e0460ae56dd--