aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-07-06 12:36:47 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-07-06 12:36:47 -0700
commitd10d93225c6d9d4948400c22df4169075758ff8c (patch)
treecc7a0764839e5604a84fc6fd2af8db8ceadaaef6 /activesupport/lib
parentd5bd7030e56d3531a1ee7949ddaac691f6b27ed2 (diff)
parentf449da53ac69495e736c7f1ce0f1bc6ebe356081 (diff)
downloadrails-d10d93225c6d9d4948400c22df4169075758ff8c.tar.gz
rails-d10d93225c6d9d4948400c22df4169075758ff8c.tar.bz2
rails-d10d93225c6d9d4948400c22df4169075758ff8c.zip
Merge pull request #1463 from psanford/master
Fix timezone handling in String.to_time
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/string/conversions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb
index 5b2cb6e331..664537eea4 100644
--- a/activesupport/lib/active_support/core_ext/string/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -34,9 +34,9 @@ class String
# Form can be either :utc (default) or :local.
def to_time(form = :utc)
return nil if self.blank?
- d = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction).map { |arg| arg || 0 }
+ d = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction, :offset).map { |arg| arg || 0 }
d[6] *= 1000000
- ::Time.send("#{form}_time", *d)
+ ::Time.send("#{form}_time", *d[0..6]) - d[7]
end
def to_date