Post links and attach files for documentation here, also chat about these docs freely

User avatar
By torntrousers
#48988
gerardwr wrote:Looking in the library the definition is:
Code: Select allvoid configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)


I am wondering what the 2nd variable of the configTime actually does (daylightOffset_sec).


Looking in portable\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266\time.c and grep'ing in all the codebase that parameter doesn't seem to ever get used for anything.
User avatar
By gerardwr
#48996
torntrousers wrote:Looking in portable\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266\time.c and grep'ing in all the codebase that parameter doesn't seem to ever get used for anything.


Thanks for the confirmation, i could not find any reference either.

As a workaround I increase the timezone variable with 3600 in case DaylightSaving is applicable.
User avatar
By gmag11
#61187 I have a NTP client library for ESP8266 and Arduino. https://github.com/gmag11/NtpClient. It is pretty easy to use. You only need a couple code lines in setup function and you can forget about it. It runs a timer internally to get periodic sync.

It uses Paul Stoffregen's Time library.

Currently it uses sdk functions to send NTP request and decode response. I agree that it is not right implemented. Precission may vary some seconds. I think it does not take network delay into account. In a future version I'll implement a more complete NTP protocol on it, to get some milliseconds accuracy.