firmware icon indicating copy to clipboard operation
firmware copied to clipboard

NTP time 1 hour behind (DST issue?)

Open obsidianxenon opened this issue 11 months ago • 14 comments

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.

obsidianxenon avatar Dec 27 '24 04:12 obsidianxenon

me too for Paris France

ademCoin avatar Dec 27 '24 08:12 ademCoin

me too for Paris France

Works fine for me..

Lamnxzp avatar Dec 27 '24 11:12 Lamnxzp

@obsidianxenon Yes, it is a DST issue.

https://github.com/pr3y/Bruce/blob/aa560a239b56c1789230ffd08b9c8d2c662cdb59/src/core/settings.cpp#L316-L329 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.

Lamnxzp avatar Dec 27 '24 14:12 Lamnxzp

@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.

obsidianxenon avatar Dec 27 '24 22:12 obsidianxenon

@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..

Lamnxzp avatar Dec 27 '24 22:12 Lamnxzp

@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.

rouing avatar Dec 28 '24 20:12 rouing

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

bmorcelli avatar Dec 28 '24 21:12 bmorcelli

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.

rouing avatar Dec 28 '24 21:12 rouing

@rouing Ok thanks mate 👍

obsidianxenon avatar Dec 28 '24 22:12 obsidianxenon

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 https://github.com/pr3y/Bruce/issues/543

lahirunirmalx avatar Dec 31 '24 08:12 lahirunirmalx

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

obsidianxenon avatar Dec 31 '24 09:12 obsidianxenon

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

bmorcelli avatar Dec 31 '24 09:12 bmorcelli

@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.

obsidianxenon avatar Dec 31 '24 09:12 obsidianxenon

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.

rouing avatar Dec 31 '24 10:12 rouing