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
This commit is contained in:
Michael Koziarski 2007-11-05 22:29:52 +00:00
parent 47576a646b
commit 7e6bb82f44

@ -173,7 +173,7 @@ def new_time(year, mon, mday, hour, min, sec, microsec)
Time.send(Base.default_timezone, year, mon, mday, hour, min, sec, microsec)
# Over/underflow to DateTime
rescue ArgumentError, TypeError
zone_offset = if Base.default_timezone == :local then DateTime.now.offset else 0 end
zone_offset = Base.default_timezone == :local ? DateTime.local_offset : 0
# Append zero calendar reform start to account for dates skipped by calendar reform
DateTime.new(year, mon, mday, hour, min, sec, zone_offset, 0) rescue nil
end