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

InternetTimeApplet@stefan: Fix timezone for accurate Beat Time calculation #5004

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

christopher-conley
Copy link
Contributor

Change the hour/minute/second variable assignments to explicitly be in UTC format. Also, add one hour to the "getUTCHours()" call, as "Biel Mean Time" (BMT), which Beat Time is based upon, is defined by Swatch as UTC+1.

Previously this was calling Date's getHours/getMinutes/getSeconds function family, which returns LOCAL time. This had the effect of the Beat time returned by this desklet always being incorrect unless your computer's time is set to the UTC+1 timezone.

This commit fixes that and ensures that the correct universal Beat Time will be displayed regardless of the user's timezone. It also incorporates the calculation changes from @nstoeckigt via his previously-merged PR here.

Original author of this applet is @stefan12O, and I'm submitting this PR per his request here.

Change the hour/minute/second variable assignments to explicitly be in UTC format. Also, add one hour to the "getUTCHours()" call, as the "Biel Mean Time" (BMT) which Beat Time is based upon, is defined by Swatch as UTC+1.

Previously this was calling Date's getHours/getMinutes/getSeconds functions, which returns LOCAL time. This had the effect of meaning the Beat time returned by this desklet was always incorrect unless your computer's time is set to the UTC+1 timezone.

This commit fixes that and ensures that the correct universal Beat Time will be displayed regardless of the user's timezone.
Change formatting to match original applet
@stefan12O
Copy link
Contributor

As agreed, thank you again.
Btw., I wasn't aware, that there was a change by Nico in 2022, somehow this bypassed my attention.

@rcalixte rcalixte merged commit 6610260 into linuxmint:master Aug 16, 2023
1 check passed
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.

3 participants