Permalink
Browse files

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 210cd75.
  • Loading branch information...
1 parent aafa00f commit d441de36971c0e5c0566def81f90a17dab3cc106 @pixeltrix pixeltrix committed Jul 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activesupport/lib/active_support/core_ext/date_time/conversions.rb
@@ -81,6 +81,7 @@ def to_i
private
def seconds_since_unix_epoch
- strftime('%s')
+ seconds_per_day = 86_400
+ (self - ::DateTime.civil(1970)) * seconds_per_day
end
end

0 comments on commit d441de3

Please sign in to comment.