ESP32 SimpleTime example

kian79
Posts: 18
Joined: Thu Jun 13, 2019 3:27 am

ESP32 SimpleTime example

Postby kian79 » Mon Jan 06, 2020 1:34 am

Hi all,

I need to keep track of the current date and time and I am looking at the SimpleTime example for the ESP32.

The example connects to Wifi and retrieve the current date and time from the ntpServer then disconnects. Then inside the main loop the printLocalTime function is called to print out the date and time. I noticed that printLocalTime doesn't retrieve data from the ntpServer anymore. I turn off my wireless router and the time is still counting.

Does the printLocalTime function just use a timer interrupt or internal RTC to continue counting? If so, anyone experience the time drifting/lagging after some time? Since its not getting data and time from ntpServer anymore, how does it keep track of leap years or daylight savings?

Who is online

Users browsing this forum: No registered users and 19 guests