diff options
author | Andrew White <andrew.white@unboxed.co> | 2017-11-11 15:19:29 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2017-11-15 09:48:50 +0000 |
commit | 2eea6458a14d99b19dffe8673015cde0800f128a (patch) | |
tree | 2dc03c75ff5b0cf9b151c6d55ab3ba86326f0a3c /guides/source/layouts_and_rendering.md | |
parent | 23c41e4657a507c574e555339821f545c819e602 (diff) | |
download | rails-2eea6458a14d99b19dffe8673015cde0800f128a.tar.gz rails-2eea6458a14d99b19dffe8673015cde0800f128a.tar.bz2 rails-2eea6458a14d99b19dffe8673015cde0800f128a.zip |
Handle `TZInfo::AmbiguousTime` errors
Make `ActiveSupport::TimeWithZone` match Ruby's handling of ambiguous
times by choosing the later period, e.g.
Ruby:
```
ENV["TZ"] = "Europe/Moscow"
Time.local(2014, 10, 26, 1, 0, 0) # => 2014-10-26 01:00:00 +0300
```
Before:
```
>> "2014-10-26 01:00:00".in_time_zone("Moscow")
TZInfo::AmbiguousTime: 26/10/2014 01:00 is an ambiguous local time.
```
After:
```
>> "2014-10-26 01:00:00".in_time_zone("Moscow")
=> Sun, 26 Oct 2014 01:00:00 MSK +03:00
```
Fixes #17395.
Diffstat (limited to 'guides/source/layouts_and_rendering.md')
0 files changed, 0 insertions, 0 deletions