Skip to content

Add tests covering "+00:00" and 0 with Time#localtime and Time.at#1285

Merged
andrykonchin merged 1 commit intoruby:masterfrom
philr:add_localtime_at_non_utc_tests
Sep 16, 2025
Merged

Add tests covering "+00:00" and 0 with Time#localtime and Time.at#1285
andrykonchin merged 1 commit intoruby:masterfrom
philr:add_localtime_at_non_utc_tests

Conversation

@philr
Copy link
Copy Markdown
Contributor

@philr philr commented Sep 16, 2025

Time#utc? should return false after passing "+00:00" or 0 to Time#localtime or as the in parameter of Time.at.

This PR adds additional test cases to cover this. These are similar to the existing test cases for "-00:00" (where Time#utc? should return true).

This recently regressed in JRuby 10.0.2.0 (see jruby/jruby#8998).

"+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.
@andrykonchin
Copy link
Copy Markdown
Member

Thank you!

@andrykonchin andrykonchin merged commit 98bdca3 into ruby:master Sep 16, 2025
12 checks passed
@philr philr deleted the add_localtime_at_non_utc_tests branch September 16, 2025 20:10
@philr philr changed the title Add tests covering "+00:00" and 0 with Time#localtime and #at Add tests covering "+00:00" and 0 with Time#localtime and Time.at Sep 16, 2025
philr added a commit to philr/jruby that referenced this pull request Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants