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
327 stars 92 forks source link

Can I use this library also without Internet connection? #22

Closed x0tester0x closed 5 years ago

x0tester0x commented 5 years ago

So for example can I use a local NTP server to get Time, Date and Timezone?

ropg commented 5 years ago

Yes you can... Simply point it to the local NTP server and do not use .setLocation. (That would try to connect to my timezone info server.)

That means you need to feed it timezone information, either as a static offset to UTC or as a 'Posix' string that has information about when to switch from Standard to Daylight Savings Time. Use the .setPosix method. (User Manual)

You can also use ezTime without any network at all, for instance if you have a time source that is not NTP, such as a hardware RTC device or a GPS receiver. In that case use setInterval() to turn off NTP updating and use .setTime (User Manual) to set/update the time yourself. Or, if you are on a memory constrained platform such as AVR Arduinos, do not even compile networking support into ezTime altogether by commenting out #define EZTIME_NETWORK_ENABLE in ezTime.h in the library's src directory. (User Manual)

x0tester0x commented 5 years ago

Can you add an example for this please?