Project

General

Profile

Actions

Bug #17024

closed

Times with timezones return incorrect wday and yday

Added by timcraft (Tim Craft) over 4 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.8.0dev
[ruby-core:99127]

Description

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 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.

I've attached a patch to the tests and specs which demonstrates the bug.


Files

patch.diff (1.03 KB) patch.diff timcraft (Tim Craft), 07/11/2020 10:19 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0