ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
343 stars 93 forks source link

NTP Management Modification #158

Open heaton84 opened 2 years ago

heaton84 commented 2 years ago

This is a nice library, almost exactly what I was looking for!

I made a couple of changes to suit my needs, namely:

  1. I added method to read variables from an NTP server via control packets. My angle is to store a timezone variable in the NTP server, and have all my clocks get the timezone data from that server. Example usage:
Timezone localTime;

bool updateTimezone()
{
  String r;
  if (readNTPVariable("TZ", r))
  {
    localTime.setPosix(r.c_str());

    return true;
  }
  return false;
}
  1. I also modified queryNTP to respect the server poll if our current poll is set too quickly. This is a courtesy to NTP server owners.