Change return type of get components to int

This commit is contained in:
Sandeep Mistry 2016-04-18 15:08:38 -04:00
parent 9070f2b11f
commit fe79989b8b
2 changed files with 12 additions and 12 deletions

View File

@ -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() {

View File

@ -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`