gmag11 / ESPNtpClient

High accuracy NTP library for ESP32 and ESP8266
MIT License
118 stars 25 forks source link

missing recover corrected unix temp with the TZ applied #11

Closed stef-ladefense closed 3 years ago

stef-ladefense commented 3 years ago

hi, I did not find how to recover with your library a corrected unix temp with the TZ applied

example NTP.setTimeZone (TZ_Europe_Paris); NTP.begin ();

something like this is missing routine timeTZ() time_t epoch = NTP.timeTZ ();

What do you think?

regards, Stephane

gmag11 commented 3 years ago

This is one of the common misconceptions about this library. Its intention is not to manage time but only to synchronize it. There is a bunch of functions in Espressif SDK that take time tracking and local time conversion works. They implement GNU time library. You can read about it here: https://gnu.huihoo.org/glibc-2.2.3/html_chapter/libc_21.html

Check localtime () function