Skip to content

Fix conversion from standard Date to Time & DateTime #429

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
merged 1 commit into from
Nov 16, 2018

Conversation

lutovich
Copy link
Contributor

Time zone offset was not converted correctly. Offset exposed by the standard JavaScript Date is the difference, in minutes, from local time to UTC. So positive offset means local time is behind UTC and negative means it's ahead. This is different from Neo4j temporal types that support time zone offsets - Time and DateTime. They define offset as the difference, in seconds, from UTC to local time. Previous code converted offset in minutes to offset in seconds but did not change the sign of the value.

Fixes #427

Time zone offset was not converted correctly. Offset exposed by the
standard JavaScript `Date` is the difference, in minutes, from local
time to UTC. So positive offset means local time is behind UTC and
negative means it's ahead. This is different from Neo4j temporal types
that support time zone offsets - `Time` and `DateTime`. They define
offset as the difference, in seconds, from UTC to local time. Previous
code converted offset in minutes to offset in seconds but did not
change the sign of the value.
@lutovich lutovich force-pushed the 1.7-timezone-offset-conversion branch from 45f2b56 to 60f301e Compare November 14, 2018 20:24
Copy link
Contributor

@ali-ince ali-ince left a comment

Choose a reason for hiding this comment

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

LGTM.

@ali-ince ali-ince merged commit a647133 into neo4j:1.7 Nov 16, 2018
@lutovich lutovich deleted the 1.7-timezone-offset-conversion branch November 19, 2018 10:15
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