Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time manipulation inconsistency with ActiveSupport::TimeZone #42466

Closed
questquest opened this issue Jun 13, 2021 · 1 comment
Closed

Time manipulation inconsistency with ActiveSupport::TimeZone #42466

questquest opened this issue Jun 13, 2021 · 1 comment

Comments

@questquest
Copy link

questquest commented Jun 13, 2021

Steps to reproduce

irb(main):001:0> zone = ActiveSupport::TimeZone['Moscow']
irb(main):002:0> zone
=> #<ActiveSupport::TimeZone:0x0000560d29ccf8d0 @name="Moscow", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: Europe/Moscow>>
irb(main):003:0> t1 = Time.new(2021, 5, 29, 0, 0, 0, '+03:00')
irb(main):004:0> t2 = Time.new(2021, 5, 29, 0, 0, 0, zone)
irb(main):005:0> t1
=> 2021-05-29 00:00:00 +0300
irb(main):006:0> t2
=> 2021-05-29 00:00:00 +0300
irb(main):007:0> t1 + 1.days
=> 2021-05-30 00:00:00 +0300
irb(main):008:0> t2 + 1.days
=> 2021-05-30 00:00:00 +0600

Expected behavior

Both times should save time zone

Actual behavior

Time object created with time zone of Active Support does not save time zone

System configuration

Rails version: 6.0.3.7

Ruby version: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

@questquest
Copy link
Author

Reopened here #42467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant