From d30de8802b22663e775171a5227a65c5d48daf1d Mon Sep 17 00:00:00 2001 From: Phil Ross Date: Tue, 16 Sep 2025 20:29:55 +0100 Subject: [PATCH] Add tests covering "+00:00" and 0 with Time#localtime and #at. "+00:00" and 0 signify a zero offset that is not treated as UTC. This is similar to the existing spec for "-00:00", which is treated as UTC. --- core/time/utc_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/time/utc_spec.rb b/core/time/utc_spec.rb index 3d36e13ccf..ab3c0df657 100644 --- a/core/time/utc_spec.rb +++ b/core/time/utc_spec.rb @@ -43,10 +43,14 @@ it "does not treat time with +00:00 offset as UTC" do Time.new(2022, 1, 1, 0, 0, 0, "+00:00").utc?.should == false + Time.now.localtime("+00:00").utc?.should == false + Time.at(Time.now, in: "+00:00").utc?.should == false end it "does not treat time with 0 offset as UTC" do Time.new(2022, 1, 1, 0, 0, 0, 0).utc?.should == false + Time.now.localtime(0).utc?.should == false + Time.at(Time.now, in: 0).utc?.should == false end end