Actions
Bug #16286
closedDateTime.parse timezone errors
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
Backport:
Description
Trying to parse a DateTime using Australian time zone abbreviations doesn't work:
>> DateTime.parse('2019-10-31 10:49:52.36400 AEST')
=> #<DateTime: 2019-10-31T10:49:52+00:00 ((2458788j,38992s,364000000n),+0s,2299161j)>
# offset is +00:00 not +10:00 ^^^^^^
As per this comment on a Rails issue, timezones are listed in ext/date/zonetab.list. Should these abbreviations be correct or are they deprecated?
Steps to reproduce:
>> require 'date'
=> true
>> DateTime.parse('2019-10-31 10:49:52.36400 AEST').zone
=> +00:00 # expected +10:00
>> DateTime.parse('2019-10-31 10:49:52.36400 AEDT').zone
=> +00:00 # expected +11:00
>> DateTime.parse('2019-10-31 10:49:52.36400 EAST').zone
=> +10:00 # expected -06:00
>> DateTime.parse('2019-10-31 10:49:52.36400 EASST').zone
=> +00:00 # expected -05:00
Additional info:
ext/date/zonetab.list lists "EAST" with an offset of +10. EAST is the abbreviation for Easter Island, not for Australia Eastern Standard Time.
References:
- the most recent data from IANA (2019c at time of writing) refers to the timezones as AEST (or AEDT for DST)
- the Australian government uses AEST (or AEDT for DST)
- EAST isn't referenced by IANA but there are several sources that use EAST for Easter Island, off the coast of Chile (-6 rather than +10).
Files
Actions
Like0
Like0Like0Like0