2 Answers
Hi DK.
We have a tutorial about NTP with the ESP32: https://randomnerdtutorials.com/esp32-ntp-client-date-time-arduino-ide/
The example should be compatible with the ESP8266, you just need to use the right wifi library:
#include <ESP8266WiFi.h>
I hope this helps.
Regards,
Sara