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=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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 591C21F9FD for ; Tue, 2 Mar 2021 11:44:48 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0EDE0120A77; Tue, 2 Mar 2021 20:43:52 +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 3C18D120A43 for ; Tue, 2 Mar 2021 20:43:49 +0900 (JST) Received: by filterdrecv-p3mdw1-7745b6f999-bhx6s with SMTP id filterdrecv-p3mdw1-7745b6f999-bhx6s-18-603E252A-34 2021-03-02 11:44:42.411317868 +0000 UTC m=+1157300.864939055 Received: from herokuapp.com (unknown) by ismtpd0101p1mdw1.sendgrid.net (SG) with ESMTP id WKstC8zWSDaFVAaVaCC07Q for ; Tue, 02 Mar 2021 11:44:42.277 +0000 (UTC) Date: Tue, 02 Mar 2021 11:44:42 +0000 (UTC) From: usa@garbagecollect.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78712 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17024 X-Redmine-Issue-Author: timcraft X-Redmine-Sender: usa 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?9Ij0W+xF+66shKwcOf8RvdqxJGkEJjaCZuueI4cieuABPn=2FOirkc3uPkb7UUdl?= =?us-ascii?Q?olrSqHizZ+J1HFT4oQkQaogsin6DLa5LksDXNPD?= =?us-ascii?Q?gRImMJL9FksSLDyoqFcDzx0E60LJjewX3qJdTRt?= =?us-ascii?Q?vJozihUWs4zE8cAFjjoKIKj5qRfOpeSLsidJLjt?= =?us-ascii?Q?z35j=2FRcbR1HQelM5fYa8OdrbrdLaYWS40gkr1jF?= =?us-ascii?Q?QVp+A6F1X2gXd0KPw=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102712 Subject: [ruby-core:102712] [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 usa (Usaku NAKAMURA). Backport changed from 2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONE to 2.5: DONTNEED, 2.6: DONE, 2.7: DONE backport into ruby_2_6 at r67911. ---------------------------------------- Bug #17024: Times with timezones return incorrect wday and yday https://bugs.ruby-lang.org/issues/17024#change-90706 * Author: timcraft (Tim Craft) * Status: Closed * Priority: Normal * ruby -v: ruby 2.8.0dev * Backport: 2.5: DONTNEED, 2.6: DONE, 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/