Change return type of get components to int
This commit is contained in:
parent
9070f2b11f
commit
fe79989b8b
@ -107,17 +107,17 @@ unsigned long NTPClient::getEpochTime() {
|
|||||||
((millis() - this->_lastUpdate) / 1000); // Time since last update
|
((millis() - this->_lastUpdate) / 1000); // Time since last update
|
||||||
}
|
}
|
||||||
|
|
||||||
String NTPClient::getDay() {
|
int NTPClient::getDay() {
|
||||||
return String(((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
|
return (((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
|
||||||
}
|
}
|
||||||
String NTPClient::getHours() {
|
int NTPClient::getHours() {
|
||||||
return String((this->getEpochTime() % 86400L) / 3600);
|
return ((this->getEpochTime() % 86400L) / 3600);
|
||||||
}
|
}
|
||||||
String NTPClient::getMinutes() {
|
int NTPClient::getMinutes() {
|
||||||
return String((this->getEpochTime() % 3600) / 60);
|
return ((this->getEpochTime() % 3600) / 60);
|
||||||
}
|
}
|
||||||
String NTPClient::getSeconds() {
|
int NTPClient::getSeconds() {
|
||||||
return String(this->getEpochTime() % 60);
|
return (this->getEpochTime() % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
String NTPClient::getFormattedTime() {
|
String NTPClient::getFormattedTime() {
|
||||||
|
@ -58,10 +58,10 @@ class NTPClient {
|
|||||||
*/
|
*/
|
||||||
bool forceUpdate();
|
bool forceUpdate();
|
||||||
|
|
||||||
String getDay();
|
int getDay();
|
||||||
String getHours();
|
int getHours();
|
||||||
String getMinutes();
|
int getMinutes();
|
||||||
String getSeconds();
|
int getSeconds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return time formatted like `hh:mm:ss`
|
* @return time formatted like `hh:mm:ss`
|
||||||
|
Loading…
Reference in New Issue
Block a user