Skip to content

A simple and efficient NTP library for ESP32 / Arduino

License

Notifications You must be signed in to change notification settings

mathieucarbou/MycilaNTP

Repository files navigation

MycilaNTP

Latest Release PlatformIO Registry

License: MIT Contributor Covenant

Build GitHub latest commit Gitpod Ready-to-Code

A simple and efficient NTP library for ESP32 / Arduino

Basic Usage

Setup:

Mycila::NTP.setTimezone("Europe/Paris")
Mycila::NTP.setNTPServer("pool.ntp.org")

Then query state:

Mycila::NTP.isSynced();
Mycila::NTP.getTimezoneInfo();

A=It is also possible to manually sync the time:

const timeval tv = {sec, millis};
Mycila::NTP.sync(tv);