From: Frederick Cheung Date: 2006-10-09T23:33:40+09:00 Subject: Re: Beginning of day given a Time value > How about this? > > class Time > def begin_of_day > self - 3600 * hour - 60 * min - sec > end > end > > It passes your unit test. ActiveSupport has a beginning_of_day method which is basically equivalent to that This approach fails will fail if daylight saving changes in between midnight and the object on which you are calling begin_of_day. For example in the UK on the 29th of october midday is 13 hours after the previous midnight. Fred -- Posted via http://www.ruby-forum.com/.