Skip to content

Commit fe79989

Browse files
committed
Change return type of get components to int
1 parent 9070f2b commit fe79989

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

NTPClient.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ unsigned long NTPClient::getEpochTime() {
107107
((millis() - this->_lastUpdate) / 1000); // Time since last update
108108
}
109109

110-
String NTPClient::getDay() {
111-
return String(((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
110+
int NTPClient::getDay() {
111+
return (((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
112112
}
113-
String NTPClient::getHours() {
114-
return String((this->getEpochTime() % 86400L) / 3600);
113+
int NTPClient::getHours() {
114+
return ((this->getEpochTime() % 86400L) / 3600);
115115
}
116-
String NTPClient::getMinutes() {
117-
return String((this->getEpochTime() % 3600) / 60);
116+
int NTPClient::getMinutes() {
117+
return ((this->getEpochTime() % 3600) / 60);
118118
}
119-
String NTPClient::getSeconds() {
120-
return String(this->getEpochTime() % 60);
119+
int NTPClient::getSeconds() {
120+
return (this->getEpochTime() % 60);
121121
}
122122

123123
String NTPClient::getFormattedTime() {

NTPClient.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ class NTPClient {
5858
*/
5959
bool forceUpdate();
6060

61-
String getDay();
62-
String getHours();
63-
String getMinutes();
64-
String getSeconds();
61+
int getDay();
62+
int getHours();
63+
int getMinutes();
64+
int getSeconds();
6565

6666
/**
6767
* @return time formatted like `hh:mm:ss`

0 commit comments

Comments
 (0)