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

UTCDate calculations are not correct when dealing with DST - incorrect 1 hour offset #12

Open
cheryllaird opened this issue Jan 17, 2025 · 0 comments

Comments

@cheryllaird
Copy link

I am trying to do some date manipulation on UTCDates, without having timezones get in the way. However when doing calculations that span over DST periods, I am finding the output has a1 hour offset due to DST.

Starting UTC date:
2025-03-30T00:59:00.000Z
Action:
Adding 1 year (European timezone)
Expected result:
2026-03-30T00:59:00.000Z
Actual result:
2026-03-29T23:59:00.000Z


Starting UTC date
2025-03-30T00:59:00.000Z
Action:
Adding 3 months (Australian timezone)
Expected result:
2025-06-30T00:59:00.000Z
Actual result:
2025-06-30T01:59:00.000Z

Codepen reference:
https://codepen.io/cheryllaird/pen/azojbxX?editors=1010

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

No branches or pull requests

1 participant