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

InternetTimeDesklet@stefan: Fix timezone for accurate Beat Time calculation #909

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

christopher-conley
Copy link
Contributor

@christopher-conley christopher-conley commented Aug 15, 2023

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.

Original author of this desklet is @stefan12O

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.
@stefan12O
Copy link
Contributor

I was never aware of this and it showed always correct, as I am in the Berlin Timezone.
Your changes are plausible and I appreciate.
Thank you very much.

As you are the one who realized, do you want to do the same change to the corresponding Applet as well ?

@rcalixte rcalixte merged commit c9d48cf into linuxmint:master Aug 15, 2023
1 check passed
@christopher-conley
Copy link
Contributor Author

christopher-conley commented Aug 16, 2023

I was never aware of this and it showed always correct, as I am in the Berlin Timezone.
Your changes are plausible and I appreciate.
Thank you very much.

As you are the one who realized, do you want to do the same change to the corresponding Applet as well ?

@stefan12O I wasn't aware there was an applet as well, but I can make a PR for that tomorrow, sure. I'll update it to include the calculation change from a previous commit in this desklet as well.

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