Project

General

Profile

Misc #19096

Updated by andrykonchin (Andrew Konchin) about 2 years ago

It's a bit unexpected but 

 ```ruby 
 Time.new(2022, 1, 1, 0, 0, 0, "-00:00").utc? 
 # => true 
 ``` 

 But time with `+00:00` or `0` offset is treated as not UTC time: 

 ```ruby 
 Time.new(2022, 1, 1, 0, 0, 0, "+00:00").utc? # => false 
 Time.new(2022, 1, 1, 0, 0, 0, 0).utc? # => false 
 ``` 

 Is it an intentional behaviour? In this case could you please clarify the reason why it works this way? 

Back