If the wifi goes off (shut down) , how long does the ESP32 keeps the time obtained ?
I’m going to hazard some guesses here but I’m assuming you mean using the built-in RTC of the ESP32 once it is set from a ntp server. The built-in RTC is not very accurate and can lose minutes per day. This is why updating the setting over WiFi is recommended. You can get external RTC’s that are much more accurate. Note that any RTC will gain/lose time so updating via ntp on a regular basis is recommended.