ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday
@ 2020-07-11 10:22 mail
  2020-07-11 12:40 ` [ruby-core:99128] " mail
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mail @ 2020-07-11 10:22 UTC (permalink / raw)
  To: ruby-core

Issue #17024 has been reported by timcraft (Tim Craft).

----------------------------------------
Bug #17024: Times with timezones return incorrect wday and yday
https://bugs.ruby-lang.org/issues/17024

* Author: timcraft (Tim Craft)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.8.0dev
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:99128] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday
  2020-07-11 10:22 [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday mail
@ 2020-07-11 12:40 ` mail
  2020-07-12 13:01 ` [ruby-core:99137] " nobu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mail @ 2020-07-11 12:40 UTC (permalink / raw)
  To: ruby-core

Issue #17024 has been updated by timcraft (Tim Craft).


For example:
```
$ irb -r tzinfo
irb(main):001:0> Time.new(2020, 1, 1, 0, 0, 0, TZInfo::Timezone.get('America/New_York')).wday
=> 7
irb(main):002:0> Time.new(2020, 1, 1, 0, 0, 0, TZInfo::Timezone.get('America/New_York')).yday
=> 0
```

(The wday should be 3, and the yday should be 1.)

----------------------------------------
Bug #17024: Times with timezones return incorrect wday and yday
https://bugs.ruby-lang.org/issues/17024#change-86504

* Author: timcraft (Tim Craft)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.8.0dev
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:99137] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday
  2020-07-11 10:22 [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday mail
  2020-07-11 12:40 ` [ruby-core:99128] " mail
@ 2020-07-12 13:01 ` nobu
  2020-07-23  2:33 ` [ruby-core:99284] " nagachika00
  2021-03-02 11:44 ` [ruby-core:102712] " usa
  3 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2020-07-12 13:01 UTC (permalink / raw)
  To: 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:99284] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday
  2020-07-11 10:22 [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday mail
  2020-07-11 12:40 ` [ruby-core:99128] " mail
  2020-07-12 13:01 ` [ruby-core:99137] " nobu
@ 2020-07-23  2:33 ` nagachika00
  2021-03-02 11:44 ` [ruby-core:102712] " usa
  3 siblings, 0 replies; 5+ messages in thread
From: nagachika00 @ 2020-07-23  2:33 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:102712] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday
  2020-07-11 10:22 [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday mail
                   ` (2 preceding siblings ...)
  2020-07-23  2:33 ` [ruby-core:99284] " nagachika00
@ 2021-03-02 11:44 ` usa
  3 siblings, 0 replies; 5+ messages in thread
From: usa @ 2021-03-02 11:44 UTC (permalink / raw)
  To: 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-02 11:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 10:22 [ruby-core:99127] [Ruby master Bug#17024] Times with timezones return incorrect wday and yday mail
2020-07-11 12:40 ` [ruby-core:99128] " mail
2020-07-12 13:01 ` [ruby-core:99137] " nobu
2020-07-23  2:33 ` [ruby-core:99284] " nagachika00
2021-03-02 11:44 ` [ruby-core:102712] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).