From df57f53d09575f8bc6542f87a3384240b66f9b4b Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 5 Mar 2007 08:34:42 +0000 Subject: Time#since overflows to DateTime. Introduce Time#to_datetime. Closes #7715. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/calculations.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support/core_ext/time/calculations.rb') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 1c2daf0606..1fdfbcdf45 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -91,6 +91,8 @@ module ActiveSupport #:nodoc: f = seconds.since(self) final_dst = f.dst? ? 1 : 0 (seconds.abs >= 86400 && initial_dst != final_dst) ? f + (initial_dst - final_dst).hours : f + rescue + self.to_datetime.since(seconds) end alias :in :since -- cgit v1.2.3