Skip to content

spline #1139 DateTimeUtils inconsistencies with default ZonedDateTime#1148

Merged
wajda merged 2 commits into
developfrom
bugfix/spline-1139-tz
Jan 9, 2023
Merged

spline #1139 DateTimeUtils inconsistencies with default ZonedDateTime#1148
wajda merged 2 commits into
developfrom
bugfix/spline-1139-tz

Conversation

@wajda
Copy link
Copy Markdown
Contributor

@wajda wajda commented Jan 4, 2023

fixes #1139

Adjusted the parseZonedDateTime utility method to allow specifying both timezone Offset and timezone geo ID.
The behavior of this method is now aligned with the logic described in the ZonedDateTime.ofLocal()

The local date-time is resolved to a single instant on the time-line. This is achieved by finding a valid offset from UTC/Greenwich for the local date-time as defined by the rules of the zone ID.
In most cases, there is only one valid offset for a local date-time. In the case of an overlap, where clocks are set back, there are two valid offsets. If the preferred offset is one of the valid offsets then it is used. Otherwise the earlier valid offset is used, typically corresponding to "summer".
In the case of a gap, where clocks jump forward, there is no valid offset. Instead, the local date-time is adjusted to be later by the length of the gap. For a typical one hour daylight savings change, the local date-time will be moved one hour later into the offset typically corresponding to "summer".

@wajda wajda requested a review from cerveada as a code owner January 4, 2023 18:50
Copy link
Copy Markdown
Contributor

@cerveada cerveada left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wajda wajda merged commit 5d23a93 into develop Jan 9, 2023
@wajda wajda deleted the bugfix/spline-1139-tz branch January 9, 2023 14:53
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.

DateTimeUtils inconsistencies with default ZonedDateTime parsing.

2 participants