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

NTP time 1 hour behind (DST issue?) #616

Open
obsidianxenon opened this issue Dec 27, 2024 · 14 comments
Open

NTP time 1 hour behind (DST issue?) #616

obsidianxenon opened this issue Dec 27, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@obsidianxenon
Copy link

When I select the NTP timezone: Sydney, the time displayed is one hour behind.

Steps To Reproduce:

  • Device used: M5Stack Cardputer
  • Configure clock
  • Set NTP timezone
  • Select Sydney

Expected behavior:
The time should be correct.

Actual behavior:
The time is an hour behind.

Additional context / logs:
At time of writing, it is daylight savings, so that could have something to do with it.

@ademCoin
Copy link

me too for Paris France

@Lamnxzp
Copy link
Contributor

Lamnxzp commented Dec 27, 2024

me too for Paris France

Works fine for me..

@Lamnxzp
Copy link
Contributor

Lamnxzp commented Dec 27, 2024

@obsidianxenon Yes, it is a DST issue.

Bruce/src/core/settings.cpp

Lines 316 to 329 in aa560a2

options = {
{"Brasilia", [&]() { bruceConfig.setTmz(-3); }, bruceConfig.tmz==-3 },
{"Pernambuco", [&]() { bruceConfig.setTmz(-2); }, bruceConfig.tmz==-2 },
{"Los Angeles", [&]() { bruceConfig.setTmz(-8); }, bruceConfig.tmz==-8 },
{"New York", [&]() { bruceConfig.setTmz(-5); }, bruceConfig.tmz==-5 },
{"Lisbon", [&]() { bruceConfig.setTmz(0); }, bruceConfig.tmz==0 },
{"Paris", [&]() { bruceConfig.setTmz(1); }, bruceConfig.tmz==1 },
{"Athens", [&]() { bruceConfig.setTmz(2); }, bruceConfig.tmz==2 },
{"Moscow", [&]() { bruceConfig.setTmz(3); }, bruceConfig.tmz==3 },
{"Dubai", [&]() { bruceConfig.setTmz(4); }, bruceConfig.tmz==4 },
{"Hong Kong", [&]() { bruceConfig.setTmz(8); }, bruceConfig.tmz==8 },
{"Tokyo", [&]() { bruceConfig.setTmz(9); }, bruceConfig.tmz==9 },
{"Sydney", [&]() { bruceConfig.setTmz(10); }, bruceConfig.tmz==10 },
{"Main Menu", [=]() { backToMenu(); }},

Here are possible options for fixing the problem:

  • Show "UTC+2, UTC+3, .., UTC+11" instead of "Sydney", "Paris"
  • Use an API like http://worldtimeapi.org, to determine what timezone, "Sydney" for example, is currently there.

Not sure which one is better.

@obsidianxenon
Copy link
Author

@Lamnxzp Ok I'll look at those. Just put of curiosity, does NTP not account for DST? If it doesn't, why not? If it does, are there any plans to bring DST to Bruce? Thanks.

@Lamnxzp
Copy link
Contributor

Lamnxzp commented Dec 27, 2024

@obsidianxenon
Currently in Bruce, If you select Sydney it will just set your timezone at 10, so UTC+10.
This will cause problems during DST, yes..

@rouing
Copy link
Contributor

rouing commented Dec 28, 2024

@bmorcelli Assign this one to me.
@obsidianxenon We dont support DST at the moment, but it is something that should be simple to do. Ill get around to this.

@bmorcelli bmorcelli added the enhancement New feature or request label Dec 28, 2024
@bmorcelli
Copy link
Collaborator

We were talking about this issue today, to use GMT-x instead of Country names.. so menu was going from -12 to +12 or something like that..

And theres an issue with places with half timezones, like India and Australia... Like GMT-x.5

@rouing
Copy link
Contributor

rouing commented Dec 28, 2024

https://github.com/JChristensen/Timezone/blob/master/src/Timezone.h

It appears there is a means to setup Timechange rules and such. Ill keep looking into this.

@obsidianxenon
Copy link
Author

@rouing Ok thanks mate 👍

@lahirunirmalx
Copy link

We were talking about this issue today, to use GMT-x instead of Country names.. so menu was going from -12 to +12 or something like that..

And theres an issue with places with half timezones, like India and Australia... Like GMT-x.5

I already open Issue for this . didn't had time to resolve this #543

@obsidianxenon
Copy link
Author

@bmorcelli There are also places that don't have DST, like Brisbane. There may have to be a location thing as well.

@bmorcelli
Copy link
Collaborator

Brazil doesn't have too.. it might be easier to setup the clock Manually

@obsidianxenon
Copy link
Author

@bmorcelli I guess you're correct. I was just looking for an easier way rather than having to set it every time I power on.

@rouing
Copy link
Contributor

rouing commented Dec 31, 2024

https://github.com/rouing/Bruce/tree/dev-timezones

Im sort of working on this now. I realized were all over the place with the time control so its gonna need a refactor. This will take a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants