Skip to content

Replace unclear fromStandardDate() #1290

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 8 commits into from
May 30, 2025
Merged

Replace unclear fromStandardDate() #1290

merged 8 commits into from
May 30, 2025

Conversation

MaxAake
Copy link
Contributor

@MaxAake MaxAake commented May 27, 2025

The Neo4j.Date functions fromStandardDate() and toStandardDate() are not inverse functions of each other, as fromStandardDate() takes the date that the StandardDate would correspond to in local time, and toStandardDate() creates a Date set at Midnight UTC.

This PR deprecates the old fromStandardDate() and replaces it with a drop-in replacement fromStandardDateLocal() which functions the same and fromStandardDateUTC() which takes the date as interpreted in UTC.

Copy link
Member

@robsdedude robsdedude left a comment

Choose a reason for hiding this comment

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

🔥 ⌚ 🙅

🙏 ☮️

Copy link
Member

Choose a reason for hiding this comment

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

Optional: I think it might be very much worthwhile to run these tests for different time zones/locales. In particular the ones that are far off of UTC (and maybe also UTC itself).

https://stackoverflow.com/questions/8083410/how-can-i-set-the-default-timezone-in-node-js

@MaxAake MaxAake force-pushed the solve-timezone-hell branch from 133bb98 to 721277b Compare May 30, 2025 06:28
@MaxAake MaxAake merged commit 1b448f5 into 6.x May 30, 2025
37 checks passed
@MaxAake MaxAake deleted the solve-timezone-hell branch May 30, 2025 12:51
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