From: Robert Klemme Date: 2009-01-27T17:20:13+09:00 Subject: Re: Time Compare 2009/1/17 list. rb : > now = Time.now > yesterday=now-1.day > tomorrow=now+1.day > > is_between = true if now > yesterday and now < tomorrow Sorry for interrupting you, but this is not a safe idiom. Why? Because of this: assuming someone had used "is_between" before then chances are that the value is logical true (there are far more true values than false values). If the date is not in between you still retain the old value of x. Instead, rather do the assignment unconditionally: is_between = now > yesterday && now < tomorrow is_between = now > yesterday and now < tomorrow You can as well do is_between = (yesterday..tomorrow).include? now but this has a slightly different semantics because it will also be true if your test time matches one of the boundaries. Kind regards robert -- remember.guy do |as, often| as.you_can - without end