From: Jules Jacobs Date: 2006-01-12T04:06:33+09:00 Subject: Re: midnight Time.now.beginning_of_day returns the beginning of today. But that's probably not what you want because this: Time.now < Time.now.beginning_of_day Would always be true unless it is 0:00. What do you want to achieve? misiek wrote: > how to use that method to returns a new time representing the start of > the day (0:00) > > > 134: def beginning_of_day > 135: (self - self.seconds_since_midnight).change(:usec => 0) > 136: end > > > i'd like to to some like taht > > if Time.now < modnight > do... > else > do.. > end > > any ideas ? -- Posted via http://www.ruby-forum.com/.