Skip to content
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

Fixes timezone bias on Windows #744

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Fixes timezone bias on Windows #744

merged 1 commit into from
Dec 9, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Dec 9, 2024

GetTimeZoneInformationreturns the bias in minutes already, so no need to adjust it.

Also handle the return code since it determines if the time zone is in the daylight saving range.

Ref: https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-gettimezoneinformation
Fixes: saghul/txiki.js#325

`GetTimeZoneInformation`returns the bias in minutes already, so no need to adjust it.

Also handle the return code since it determines if the time zone is in the daylight saving range.

Ref: https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-gettimezoneinformation
Fixes: saghul/txiki.js#325
@saghul saghul requested a review from bnoordhuis December 9, 2024 21:33
@saghul
Copy link
Contributor Author

saghul commented Dec 9, 2024

Hopefully I ended up on the right side of the rabbithole 😅 PTAL @bnoordhuis

@saghul saghul merged commit 53b641d into master Dec 9, 2024
59 checks passed
@saghul saghul deleted the saghul-patch-1 branch December 9, 2024 21: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.

Windows: Date() ignores timezome
2 participants