提交 7e6bb82f 编写于 作者: M Michael Koziarski

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
上级 47576a64
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册