From d441de36971c0e5c0566def81f90a17dab3cc106 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 1 Jul 2012 17:27:49 +0100 Subject: Revert "Use strftime to convert DateTime to numeric" There appears to be a bug with DateTime#strftime("%s") on 32-bit platforms. Bug report: http://bugs.ruby-lang.org/issues/6683 This reverts commit 210cd756a628cc19c0d6e44bee8c33dfb2d9d598. --- activesupport/lib/active_support/core_ext/date_time/conversions.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/date_time') diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb index 262c03540b..a4a6562c74 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -81,6 +81,7 @@ class DateTime private def seconds_since_unix_epoch - strftime('%s') + seconds_per_day = 86_400 + (self - ::DateTime.civil(1970)) * seconds_per_day end end -- cgit v1.2.3