[ruby-core:112160] [Ruby master Misc#19096] [Question] Time with `-00:00` offset is in UTC

Issue #19096 has been updated by duerst (Martin Dürst). I'm not sure whether and how much this is relevant, but please note that the Sedate WG in the IETF has a draft (https://www.ietf.org/archive/id/draft-ietf-sedate-datetime-extended-07.html, close to final) that updates RFC 3339 (https://www.rfc-editor.org/rfc/rfc3339). For details, please check https://www.ietf.org/archive/id/draft-ietf-sedate-datetime-extended-07.html#.... ---------------------------------------- Misc #19096: [Question] Time with `-00:00` offset is in UTC https://bugs.ruby-lang.org/issues/19096#change-101597 * Author: andrykonchin (Andrew Konchin) * Status: Closed * Priority: Normal ---------------------------------------- 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) ``` -- https://bugs.ruby-lang.org/
participants (1)
-
duerst