We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It does not change the time zone:
# https://github.com/travisjeffery/timecop/blob/master/test/time_stack_item_test.rb#L278 # def test_freezing_a_time_with_zone_returns_proper_zones Time.zone = "Hawaii" t = ActiveSupport::TimeWithZone.new(Time.utc(2000, 1, 1), ActiveSupport::TimeZone['Tokyo']) Timecop.freeze(t) do local_now = Time.now assert_equal t, local_now assert_equal t.getlocal.zone, local_now.zone zoned_now = Time.zone.now assert_equal t, zoned_now assert_equal 'HST', zoned_now.zone end end
[26] pry(#<TestTimeStackItem>)> t.zone => "JST" [27] pry(#<TestTimeStackItem>)> local_now.zone => " 04" [28] pry(#<TestTimeStackItem>)> t.getlocal.zone => " 04"
@travisjeffery @joshuacronemeyer Is it expected behavior? I wanted to use in my test cases Time.utc(2024, 1, 1), but because we use localtime here https://github.com/travisjeffery/timecop/blob/master/lib/timecop/time_stack_item.rb#L78 it does not work
Time.utc(2024, 1, 1)
localtime
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It does not change the time zone:
@travisjeffery @joshuacronemeyer Is it expected behavior? I wanted to use in my test cases
Time.utc(2024, 1, 1)
, but because we uselocaltime
here https://github.com/travisjeffery/timecop/blob/master/lib/timecop/time_stack_item.rb#L78 it does not workThe text was updated successfully, but these errors were encountered: