Actions
Misc #19096
closed[Question] Time with `-00:00` offset is in UTC
Status:
Closed
Assignee:
-
Description
It's a bit unexpected but
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:
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)
Actions
Like0
Like0Like0Like0Like1Like0Like0Like0Like0Like0Like0Like0