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

Run tzset() and localtime() in getTZOffset() to ensure proper timezone offset #3999

Merged
merged 2 commits into from
May 31, 2024

Conversation

jp-bennett
Copy link
Collaborator

Fixes #3812
My guess is that we run tzset before we have a valid date, so the DST element can't happen. This moves that to every time we attempt to calculate the offset, as well as moving to localtime() to make sure we get the proper timezone offset.

@jp-bennett jp-bennett requested a review from caveman99 May 31, 2024 02:28
@jp-bennett jp-bennett marked this pull request as draft May 31, 2024 03:52
@jp-bennett jp-bennett marked this pull request as ready for review May 31, 2024 06:11
@jp-bennett
Copy link
Collaborator Author

I misunderstood the problem the first time around (and had a local node broadcasting a bogus time). The solution is actually really simple: Just use the real time for our "now" variable, to calculate the offset.

@thebentern thebentern merged commit 54bccb8 into master May 31, 2024
82 checks passed
@thebentern thebentern deleted the fix-timezone branch May 31, 2024 12: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.

[Bug]: POSIX Timezone offset incorectly on T-Echo - but correct on a Haltec v3
2 participants