File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ unsigned long NTPClient::getEpochTime() const {
136136 ((millis () - this ->_lastUpdate ) / 1000 ); // Time since last update
137137}
138138
139+ unsigned long NTPClient::getUTCEpochTime () const {
140+ return this ->_currentEpoc + // Epoch returned by the NTP server
141+ ((millis () - this ->_lastUpdate ) / 1000 ); // Time since last update
142+ }
143+
139144int NTPClient::getDay () const {
140145 return (((this ->getEpochTime () / 86400L ) + 4 ) % 7 ); // 0 is Sunday
141146}
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ class NTPClient {
107107 */
108108 unsigned long getEpochTime () const ;
109109
110+ /* *
111+ * @return time in seconds since Jan. 1, 1970
112+ */
113+ unsigned long getUTCEpochTime () const ;
110114 /* *
111115 * Stops the underlying UDP client
112116 */
You can’t perform that action at this time.
0 commit comments