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
336 stars 93 forks source link

Feature request: expose _last_sync_time #30

Closed mike-s123 closed 5 years ago

mike-s123 commented 5 years ago

It's great that it's logged in debug output, but it would be useful to be able to know programmatically when the last good network update occurred. Perhaps time_t lastNtpUpdateTime()

ropg commented 5 years ago

You wanna do this and make it a pull request or do I make it?

mike-s123 commented 5 years ago

As I mentioned, I'm not that much of a coder. I can figure out logic errors and do basic stuff. But properly creating new functions in an object-oriented environment, etc., not so much.

keith0603 commented 5 years ago

I would like to see this as well, but like mike-s123, don't have the knowledge to do the pull request myself. To add context, I am using the code on an esp8266 as a time-keeper feeding into a arduino that is running additional code. I want to keep the interrupts to the arduino a minimum, so only wanted to update after a NTP sync. If the internal NTP sync event were exposed, it seems an easy way to accomplish this. Great library and lives up to it's name! Thank you.

ropg commented 5 years ago

Added in 0.7.10