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-Status: No, score=-2.1 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=no 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 8CDE91F5AE for ; Thu, 23 Jul 2020 02:33:30 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id BF07E120B30; Thu, 23 Jul 2020 11:33:00 +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 31E0F120B2F for ; Thu, 23 Jul 2020 11:32:57 +0900 (JST) Received: by filterdrecv-p3las1-7754f7d4cc-smbzq with SMTP id filterdrecv-p3las1-7754f7d4cc-smbzq-19-5F18F6F3-4E 2020-07-23 02:33:23.985568939 +0000 UTC m=+2362780.716776254 Received: from herokuapp.com (unknown) by ismtpd0012p1iad2.sendgrid.net (SG) with ESMTP id pw5CkSV4Qo6n6KhmoPa6Bg for ; Thu, 23 Jul 2020 02:33:23.768 +0000 (UTC) Date: Thu, 23 Jul 2020 02:33:24 +0000 (UTC) From: nagachika00@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75073 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17024 X-Redmine-Issue-Author: timcraft X-Redmine-Sender: nagachika 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?O2wxg26uOO6cft6GjkEp=2FGevTnH9lR=2FEdG60AX3F8=2FC3iaH3aX0XAIjb4DfGJr?= =?us-ascii?Q?C0GeGh9iH34i5WZwVp3UNGbjjdPfnDvxzpqxRh7?= =?us-ascii?Q?4lC5TIZnC8dsZ5QOpaJJ=2F97CNz=2FTaa+axbaIc32?= =?us-ascii?Q?T5BxgqVXi3orhJizAVPokGwVUDxCUk=2Fnmhy92c7?= =?us-ascii?Q?=2FqhNh+ycUzFFWmtLj9Q7CyrvPlEym+Ge1IbWGTJ?= =?us-ascii?Q?cP7w9xw2NG1nreJRE=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99284 Subject: [ruby-core:99284] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday 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 #17024 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.5: DONTNEED, 2.6: REQUIRED, 2.7: REQUIRED to 2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONE ruby_2_7 4be9bf1f67b997fc519625d56a93b8a68a70d124 merged revision(s) 99a9c3fe2eaab8157765d792dc871da6daea0327. ---------------------------------------- Bug #17024: Times with timezones return incorrect wday and yday https://bugs.ruby-lang.org/issues/17024#change-86671 * Author: timcraft (Tim Craft) * Status: Closed * Priority: Normal * ruby -v: ruby 2.8.0dev * Backport: 2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONE ---------------------------------------- The timezone support added to Time in Ruby 2.6 does not appear to handle wday and yday. I don't know what the most appropriate fix is, but looking at time.c and [the commit which introduced the timezone feature](https://github.com/ruby/ruby/commit/ee58c638b8d10d2ea10faadbc7b34515d2f2e351) it looks like `vtm->wday` and `vtm->yday` are both set by `vtm_add_offset`, and that isn't called with the [new block of code which handles the timezone](https://github.com/ruby/ruby/blob/ee58c638b8d10d2ea10faadbc7b34515d2f2e351/time.c#L2261-L2272). I've attached a patch to the tests and specs which demonstrates the bug. ---Files-------------------------------- patch.diff (1.03 KB) -- https://bugs.ruby-lang.org/