Skip to content

Fix DateTime with ZoneId unpacking #1098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bigmontz
Copy link
Contributor

The timezone offset was miss-calculated because of an error on extracting timezone information when the hour equals to 0. The problems happens because Intl.DateTimeFormat when configured with hour12: false returns 0 hour as 24.

The solution for this is convert 24 to 0 before calculate the offset.

NOTE:
Other valid solution would be change hourCycle to h23. However, this solution is not supported by all javascript environment.

Backports: #1097

The timezone offset was miss-calculated because of an error on extracting timezone information when the hour equals to `0`.
The problems happens because `Intl.DateTimeFormat` when configured with `hour12: false` returns `0` hour as `24`.

The solution for this is convert `24` to `0` before calculate the `offset`.

NOTE:
Other valid solution would be change `hourCycle` to `h23`.
However, this solution is not supported by all javascript environment.
@bigmontz bigmontz requested a review from ConorNeo June 16, 2023 11:25
@bigmontz bigmontz linked an issue Jun 16, 2023 that may be closed by this pull request
@bigmontz bigmontz merged commit 0436752 into neo4j:4.4 Jun 16, 2023
@bigmontz bigmontz deleted the 4.4.-fix-unpacking-of-date-with-timezoneid branch June 19, 2023 07:23
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.

Datetime function timezone issue
2 participants