Arduino library to read time from Network Time Protocol (NTP) servers.
NodeMCU
Using EasyNTPClient on a NodeMCU (ESP8266)
ArduinoEspWifiShield
Using EasyNTPClient on an Arduino UNO with an ESP-01 (ESP8266) WiFi module.
By Claran Martis
EasyNTPClient(UDP &udp)
Parameters:
udp: Reference to an UDP object.
Returns:
EasyNTPClient object.
EasyNTPClient(UDP& udp, const char* serverPool)
Parameters:
udp: Reference to an UDP object.
serverPool: NTP server pool. Default = "pool.ntp.org"
Returns:
EasyNTPClient object.
EasyNTPClient(UDP& udp, const char* serverPool, int offset);
Parameters:
udp: Reference to an UDP object.
serverPool: NTP server pool domain name. Default = "pool.ntp.org"
offset: Difference from UTC in seconds. Default = 0
Returns:
EasyNTPClient object.
int getTimeOffset()
Returns:
EasyNTPClient object.
void setTimeOffset(int offset);
Parameters:
offset: Difference from UTC in seconds.
unsigned long getUnixTime();
Returns:
UTC time in UNIX time format (seconds)