File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -101,27 +101,27 @@ bool NTPClient::update() {
101101 return true ;
102102}
103103
104- unsigned long NTPClient::getRawTime () {
104+ unsigned long NTPClient::getEpochTime () {
105105 return this ->_timeOffset + // User offset
106106 this ->_currentEpoc + // Epoc returned by the NTP server
107107 ((millis () - this ->_lastUpdate ) / 1000 ); // Time since last update
108108}
109109
110110String NTPClient::getDay () {
111- return String (((this ->getRawTime () / 86400L ) + 4 ) % 7 ); // 0 is Sunday
111+ return String (((this ->getEpochTime () / 86400L ) + 4 ) % 7 ); // 0 is Sunday
112112}
113113String NTPClient::getHours () {
114- return String ((this ->getRawTime () % 86400L ) / 3600 );
114+ return String ((this ->getEpochTime () % 86400L ) / 3600 );
115115}
116116String NTPClient::getMinutes () {
117- return String ((this ->getRawTime () % 3600 ) / 60 );
117+ return String ((this ->getEpochTime () % 3600 ) / 60 );
118118}
119119String NTPClient::getSeconds () {
120- return String (this ->getRawTime () % 60 );
120+ return String (this ->getEpochTime () % 60 );
121121}
122122
123123String NTPClient::getFormattedTime () {
124- unsigned long rawTime = this ->getRawTime ();
124+ unsigned long rawTime = this ->getEpochTime ();
125125 unsigned long hours = (rawTime % 86400L ) / 3600 ;
126126 String hoursStr = hours < 10 ? " 0" + String (hours) : String (hours);
127127
Original file line number Diff line number Diff line change @@ -69,9 +69,9 @@ class NTPClient {
6969 String getFormattedTime ();
7070
7171 /* *
72- * @return time as raw seconds
72+ * @return time in seconds since Jan. 1, 1970
7373 */
74- unsigned long getRawTime ();
74+ unsigned long getEpochTime ();
7575
7676 /* *
7777 * Stops the underlying UDP client
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ getHours KEYWORD2
1717getMinutes KEYWORD2
1818getSeconds KEYWORD2
1919getFormattedTime KEYWORD2
20- getRawTime KEYWORD2
20+ getEpochTime KEYWORD2
You can’t perform that action at this time.
0 commit comments