From b4c34f7b2b18720381b3c8cfa79f66a530b3ed0b Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sun, 31 Jul 2005 09:16:21 +0000 Subject: Fixed that Time#midnight would have a non-zero usec on some platforms #1836 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/calculations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 8247003ca3..503717f4fe 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -101,7 +101,7 @@ module ActiveSupport #:nodoc: # Returns a new Time representing the start of the day (0:00) def beginning_of_day - self - self.seconds_since_midnight + (self - self.seconds_since_midnight).change(:usec => 0) end alias :midnight :beginning_of_day alias :at_midnight :beginning_of_day @@ -132,4 +132,4 @@ module ActiveSupport #:nodoc: end end end -end \ No newline at end of file +end -- cgit v1.2.3