Skip to content
This repository
Browse code

Use the safe conversion code introduced in earlier commit. References #…

…10068 [gbuesing]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 7e6bb82f44782deeedc81886b6f2abd7f69a982c 1 parent 47576a6
Michael Koziarski authored November 05, 2007
2  activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -173,7 +173,7 @@ def new_time(year, mon, mday, hour, min, sec, microsec)
173 173
             Time.send(Base.default_timezone, year, mon, mday, hour, min, sec, microsec)
174 174
           # Over/underflow to DateTime
175 175
           rescue ArgumentError, TypeError
176  
-            zone_offset = if Base.default_timezone == :local then DateTime.now.offset else 0 end
  176
+            zone_offset = Base.default_timezone == :local ? DateTime.local_offset : 0
177 177
             # Append zero calendar reform start to account for dates skipped by calendar reform
178 178
             DateTime.new(year, mon, mday, hour, min, sec, zone_offset, 0) rescue nil
179 179
           end

0 notes on commit 7e6bb82

Please sign in to comment.
Something went wrong with that request. Please try again.