Project

General

Profile

Misc #19096

Updated by andrykonchin (Andrew Konchin) over 1 year 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? 

 --- 

 ``` 
 ruby -v 
 ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) 
 ``` 

Back