From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 599FC1F4C0 for ; Thu, 31 Oct 2019 00:47:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F1287120A0A; Thu, 31 Oct 2019 09:46:51 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3F961120A06 for ; Thu, 31 Oct 2019 09:46:50 +0900 (JST) Received: by filter0190p3mdw1.sendgrid.net with SMTP id filter0190p3mdw1-17110-5DBA2EFE-4 2019-10-31 00:46:54.046942796 +0000 UTC m=+28283.628834380 Received: from herokuapp.com (unknown [18.215.166.206]) by ismtpd0036p1mdw1.sendgrid.net (SG) with ESMTP id J_iIbVJ2SAaYhacyQaRk6Q for ; Thu, 31 Oct 2019 00:46:53.973 +0000 (UTC) Date: Thu, 31 Oct 2019 00:46:54 +0000 (UTC) From: MATTHEW@SAGACITY.COM.AU Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71190 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16286 X-Redmine-Issue-Author: matt17r X-Redmine-Sender: matt17r X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?aQfge25MMmdxcuVOWfGwBOaZdD1MRF8XSz53m65Sl07zlGkzyJrSlO8utjg9wn?= =?us-ascii?Q?pa0xgz+I0CK896m0rLM=2FCy0uyW2gXeWOm2i0qcV?= =?us-ascii?Q?SOKOHrhQ+=2FHJpLdjq6zeCoUzwALavgQcruP5nvv?= =?us-ascii?Q?eacCSlsX9TQKhKeVRNlMIZfNYnUAT5bqfAz2R3B?= =?us-ascii?Q?DSgwEBm7xFErVKg7rHqFAbrVaNESpXGZ+Kg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95597 Subject: [ruby-core:95597] [Ruby master Bug#16286] DateTime.parse timezone errors X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16286 has been reported by matt17r (Matthew LS). ---------------------------------------- Bug #16286: DateTime.parse timezone errors https://bugs.ruby-lang.org/issues/16286 * Author: matt17r (Matthew LS) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Trying to parse a DateTime using Australian time zone abbreviations doesn't work: ``` >> DateTime.parse('2019-10-31 10:49:52.36400 AEST') => # # offset is +00:00 not +10:00 ^^^^^^ ``` As per [this comment on a Rails issue](https://github.com/rails/rails/issues/36972#issuecomment-526260754), timezones are listed in [ext/date/zonetab.list](https://github.com/ruby/ruby/blob/master/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](https://github.com/ruby/ruby/blob/master/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: 1. the most recent data from [IANA](https://data.iana.org/time-zones/releases/?C=M;O=D) ([2019c at time of writing](https://data.iana.org/time-zones/releases/tzdata2019c.tar.gz)) refers to the timezones as *AEST* (or *AEDT* for DST) 2. the [Australian government](https://www.australia.gov.au/about-australia/facts-and-figures/time-zones-and-daylight-saving) uses *AEST* (or *AEDT* for DST) 3. *EAST* isn't referenced by IANA but [there](https://www.worldtimeserver.com/time-zones/east/) [are](https://24timezones.com/time-zone/east) [several](https://time.is/EAST) [sources](https://www.timeanddate.com/time/zones/east) that use *EAST* for Easter Island, off the coast of Chile (-6 rather than +10). ---Files-------------------------------- DateTime_parse_AEST_timezone_issue.rb (479 Bytes) -- https://bugs.ruby-lang.org/