Skip to content

fix: honor ISO 8601 offsets when deserializing dates - #443

Merged
andrii-bodnar merged 1 commit into
crowdin:masterfrom
pcbeingused333:fix/c3664-date-offset
Nov 17, 2026
Merged

andrii-bodnar merged 1 commit into
crowdin:masterfrom
pcbeingused333:fix/c3664-date-offset

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

ISO 8601 timestamps with an explicit offset are currently parsed with a format that stops before the offset. Consequently, the same API response produces different instants depending on the JVM's default time zone. For example, 2019-07-11T07:40:22+00:00 becomes 2019-07-11T11:40:22Z in America/New_York.

Parse offset-bearing ISO timestamps with Java 8's OffsetDateTime and convert the resulting instant to Date. Keep the existing parsing paths for legacy timestamps without a zone. This also preserves fractional seconds in ISO timestamps.

Regression tests exercise the registered Jackson deserializer under a non-UTC default time zone, covering zero, positive and negative offsets, Z, fractional seconds, and legacy and empty values. The original default zone is restored after each test.

Validation: ./gradlew --offline --no-daemon build passes all 894 tests on JDK 8 with Gradle 7.6.4. The regression test fails on the original implementation (1 failure out of 2 tests) and passes with the fix (2 tests).

AI assistance was used to prepare this change and its tests.

@andrii-bodnar andrii-bodnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcbeingused333 thank you!

@andrii-bodnar
andrii-bodnar merged commit 07ab8dc into crowdin:master Nov 17, 2026
2 checks passed
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