[ruby-core:111557] [Ruby master Bug#19292] Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given

Issue #19292 has been reported by matsuda (Akira Matsuda). ---------------------------------------- Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given https://bugs.ruby-lang.org/issues/19292 * Author: matsuda (Akira Matsuda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-30T15:31:50Z master 0bb07e5ba4) +YJIT [arm64-darwin21] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').wday" 7 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').yday" 0 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').isdst" -e:1:in `isdst': isdst is not set yet (RuntimeError) from -e:1:in `<main>' $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').to_a" [0, 0, 0, 1, 1, 2023, 7, 0, true, "UTC"] where the expected `to_a` value should be: [0, 0, 0, 1, 1, 2023, 0, 1, false, "UTC"] This bug seems to be happening on the following conditions: - On any given date and time, regardless of past or future - Either on `Time.new(Integer, Integer, ...)` style or `Time.new(String)` style - Only when `in: 'UTC'` kwarg was given. Other formats like `in: '+0000'` or `in: 0` seems to be OK - On all Ruby versions that accept kwarg `in:` (3.1, 3.2, and 3.3) -- https://bugs.ruby-lang.org/

Issue #19292 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/7051 ---------------------------------------- Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given https://bugs.ruby-lang.org/issues/19292#change-100922 * Author: matsuda (Akira Matsuda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-30T15:31:50Z master 0bb07e5ba4) +YJIT [arm64-darwin21] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: UNKNOWN, 3.2: REQUIRED ---------------------------------------- $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').wday" 7 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').yday" 0 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').isdst" -e:1:in `isdst': isdst is not set yet (RuntimeError) from -e:1:in `<main>' $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').to_a" [0, 0, 0, 1, 1, 2023, 7, 0, true, "UTC"] where the expected `to_a` value should be: [0, 0, 0, 1, 1, 2023, 0, 1, false, "UTC"] This bug seems to be happening on the following conditions: - On any given date and time, regardless of past or future - Either on `Time.new(Integer, Integer, ...)` style or `Time.new(String)` style - Only when `in: 'UTC'` kwarg was given. Other formats like `in: '+0000'` or `in: 0` seems to be OK - On all Ruby versions that accept kwarg `in:` (3.1, 3.2, and 3.3) -- https://bugs.ruby-lang.org/

Issue #19292 has been updated by matsuda (Akira Matsuda). Confirmed the fix. Thank you, @nobu! ---------------------------------------- Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given https://bugs.ruby-lang.org/issues/19292#change-100929 * Author: matsuda (Akira Matsuda) * Status: Closed * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-30T15:31:50Z master 0bb07e5ba4) +YJIT [arm64-darwin21] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').wday" 7 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').yday" 0 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').isdst" -e:1:in `isdst': isdst is not set yet (RuntimeError) from -e:1:in `<main>' $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').to_a" [0, 0, 0, 1, 1, 2023, 7, 0, true, "UTC"] where the expected `to_a` value should be: [0, 0, 0, 1, 1, 2023, 0, 1, false, "UTC"] This bug seems to be happening on the following conditions: - On any given date and time, regardless of past or future - Either on `Time.new(Integer, Integer, ...)` style or `Time.new(String)` style - Only when `in: 'UTC'` kwarg was given. Other formats like `in: '+0000'` or `in: 0` seems to be OK - On all Ruby versions that accept kwarg `in:` (3.1, 3.2, and 3.3) -- https://bugs.ruby-lang.org/

Issue #19292 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE ruby_3_2 89cd61890fe78e0491708f87a5df678b03fda8a3 merged revision(s) 542e984d82fa25098eb15398d716d907acc52b93. ---------------------------------------- Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given https://bugs.ruby-lang.org/issues/19292#change-101284 * Author: matsuda (Akira Matsuda) * Status: Closed * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-30T15:31:50Z master 0bb07e5ba4) +YJIT [arm64-darwin21] * Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE ---------------------------------------- $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').wday" 7 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').yday" 0 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').isdst" -e:1:in `isdst': isdst is not set yet (RuntimeError) from -e:1:in `<main>' $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').to_a" [0, 0, 0, 1, 1, 2023, 7, 0, true, "UTC"] where the expected `to_a` value should be: [0, 0, 0, 1, 1, 2023, 0, 1, false, "UTC"] This bug seems to be happening on the following conditions: - On any given date and time, regardless of past or future - Either on `Time.new(Integer, Integer, ...)` style or `Time.new(String)` style - Only when `in: 'UTC'` kwarg was given. Other formats like `in: '+0000'` or `in: 0` seems to be OK - On all Ruby versions that accept kwarg `in:` (3.1, 3.2, and 3.3) -- https://bugs.ruby-lang.org/

Issue #19292 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ruby_3_1 3efc43aace4e051f618b10e82bd82e93076dc757 merged revision(s) 542e984d82fa25098eb15398d716d907acc52b93. ---------------------------------------- Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given https://bugs.ruby-lang.org/issues/19292#change-102479 * Author: matsuda (Akira Matsuda) * Status: Closed * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-30T15:31:50Z master 0bb07e5ba4) +YJIT [arm64-darwin21] * Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE, 3.2: DONE ---------------------------------------- $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').wday" 7 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').yday" 0 $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').isdst" -e:1:in `isdst': isdst is not set yet (RuntimeError) from -e:1:in `<main>' $ ruby -e "p Time.new(2023, 1, 1, 0, 0, 0, in: 'UTC').to_a" [0, 0, 0, 1, 1, 2023, 7, 0, true, "UTC"] where the expected `to_a` value should be: [0, 0, 0, 1, 1, 2023, 0, 1, false, "UTC"] This bug seems to be happening on the following conditions: - On any given date and time, regardless of past or future - Either on `Time.new(Integer, Integer, ...)` style or `Time.new(String)` style - Only when `in: 'UTC'` kwarg was given. Other formats like `in: '+0000'` or `in: 0` seems to be OK - On all Ruby versions that accept kwarg `in:` (3.1, 3.2, and 3.3) -- https://bugs.ruby-lang.org/
participants (4)
-
matsuda (Akira Matsuda)
-
nagachika (Tomoyuki Chikanaga)
-
naruse (Yui NARUSE)
-
nobu (Nobuyoshi Nakada)