From: nagachika00@... Date: 2020-07-23T02:33:24+00:00 Subject: [ruby-core:99284] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday 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/ Unsubscribe: