Page 1 of 1
Ntp Sumertime changes at the Amerikan Date
Posted: Sun Mar 14, 2021 4:39 pm
by JonaB111
Hello, on my Esp32 clock the time change today to summertime. However this should happen at the 28.3 not at the 14.3 in Germany. Im using Esp32's time Lib and i don't know how to change it.
Thanks for every Help!
Re: Ntp Sumertime changes at the Amerikan Date
Posted: Mon Mar 15, 2021 4:02 am
by ESP_Sprite
Esp32's time Lib
No such thing, you're probably using a 3rd party lib, one from a different SDK, or the ESP-IDF POSIX built-in functions. In case of the last, refer to the
manual. In case you don't use that, please specify what you do use.
Re: Ntp Sumertime changes at the Amerikan Date
Posted: Mon Mar 15, 2021 12:14 pm
by JonaB111
Honestly I am a bit confused, what im using, because i use the one which comes with the esp32 i just include time.h and the functions are the same like in ESP-IDF POSIX but the ntp syncronization is done differently. I folowed the guide on
https://randomnerdtutorials.com/esp32-d ... r-arduino/
Re: Ntp Sumertime changes at the Amerikan Date
Posted: Mon Mar 15, 2021 5:02 pm
by WiFive
The arduino function configTime does not let you set the dst rule and so defaults to US rule
Re: Ntp Sumertime changes at the Amerikan Date
Posted: Tue Mar 16, 2021 3:18 am
by ESP_Sprite
However, I think you should still be able to set the timezone using the TZ variable; refer to the manual page I linked earlier. Specifically, something like
Code: Select all
// Set timezone to China Standard Time
setenv("TZ", "CST-8", 1);
tzset()
and then using 'localtime' to get the time should work.