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=-4.1 required=3.0 tests=AWL,BAYES_00, 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 37D8F1F5AE for ; Sun, 12 Jul 2020 13:01:44 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C076B12095E; Sun, 12 Jul 2020 22:01:12 +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 E141212095D for ; Sun, 12 Jul 2020 22:01:10 +0900 (JST) Received: by filterdrecv-p3mdw1-75c584b9c6-q9wps with SMTP id filterdrecv-p3mdw1-75c584b9c6-q9wps-21-5F0B09AD-9D 2020-07-12 13:01:33.487485586 +0000 UTC m=+1367516.383881940 Received: from herokuapp.com (unknown) by ismtpd0122p1mdw1.sendgrid.net (SG) with ESMTP id 9YwXOb5lSy6IU3uFYlk8Og for ; Sun, 12 Jul 2020 13:01:33.335 +0000 (UTC) Date: Sun, 12 Jul 2020 13:01:33 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 74927 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17024 X-Redmine-Issue-Author: timcraft X-Redmine-Sender: nobu 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?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4Bxu7FAK9cTdFJsBRKhnro?= =?us-ascii?Q?xMsAo6m=2FKgLh=2FGG2Em=2F9B7CYUFmT6VwL57AKDrb?= =?us-ascii?Q?4E4bbrGz+CmmJ8pdprxF+yceBoM4NaQHG0a7AG0?= =?us-ascii?Q?6YlKpZ3yYv4E59yc+9lz8DSwCjM2g4ipTx5Fy+O?= =?us-ascii?Q?yeIvtMOYEtRpaS7u2MMGXb5iv5d2+sz0AmqQwuW?= =?us-ascii?Q?l7pVK0ss0nwVQf2T4=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99137 Subject: [ruby-core:99137] [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 nobu (Nobuyoshi Nakada). Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: DONTNEED, 2.6: REQUIRED, 2.7: REQUIRED https://github.com/ruby/ruby/pull/3312 ---------------------------------------- Bug #17024: Times with timezones return incorrect wday and yday https://bugs.ruby-lang.org/issues/17024#change-86514 * Author: timcraft (Tim Craft) * Status: Open * Priority: Normal * ruby -v: ruby 2.8.0dev * Backport: 2.5: DONTNEED, 2.6: REQUIRED, 2.7: REQUIRED ---------------------------------------- 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/