You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the sntp_set_timezone function accepts an integer with limits set between -11 and 13 (UTC hour offsets). This limits the use for timezones that have not an offset of an exact hour. See for example UTC−09:30.
Additionally there is also a UTC offset UTC−12:00 and UTC+14:00.
It would be good if the code could be updated to reflect the correct UTC offsets. In that regards it might be better to express the function argument in seconds (rather than hours). This would support for timezones like UTC-09:30.
The text was updated successfully, but these errors were encountered:
As of the present core, the timezone is expressed in seconds in the call to configTime(....). However after being passed to the underlying function in time.c it is divided by 3600, when calling the sntp function sntp_set_timezone(sint8 timezone), where it gets rounded back to a whole number.
I tried to change the datatype on the relevant functions in sntp.c/.h and time.c/.h hoping that it might be a simple fix for timezones that are not a full hour difference, but it didn't seem to work.
Also (somewhat related) changing daylightOffset_sec doesn't seem to be a workaround when trying to add that half an hour either.
@devyte Could you perhaps send a link for these two libraries you are referring to? There are many with the same name :).
NTPClientLib has timezone support but with a similar limitation (time difference is an uint8_t) and TimeLib has no timezone support (This is if these are the ones you are referring to).
Currently the
sntp_set_timezone
function accepts an integer with limits set between -11 and 13 (UTC hour offsets). This limits the use for timezones that have not an offset of an exact hour. See for example UTC−09:30.There are a few more such timezones (See: https://en.wikipedia.org/wiki/Time_zone#List_of_UTC_offsets)
Additionally there is also a UTC offset UTC−12:00 and UTC+14:00.
It would be good if the code could be updated to reflect the correct UTC offsets. In that regards it might be better to express the function argument in seconds (rather than hours). This would support for timezones like UTC-09:30.
The text was updated successfully, but these errors were encountered: