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:
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
|
||||
|
Loading…
Reference in New Issue
Block a user