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
}
String NTPClient::getDay() {
return String(((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
int NTPClient::getDay() {
return (((this->getEpochTime() / 86400L) + 4 ) % 7); //0 is Sunday
}
String NTPClient::getHours() {
return String((this->getEpochTime() % 86400L) / 3600);
int NTPClient::getHours() {
return ((this->getEpochTime() % 86400L) / 3600);
}
String NTPClient::getMinutes() {
return String((this->getEpochTime() % 3600) / 60);
int NTPClient::getMinutes() {
return ((this->getEpochTime() % 3600) / 60);
}
String NTPClient::getSeconds() {
return String(this->getEpochTime() % 60);
int NTPClient::getSeconds() {
return (this->getEpochTime() % 60);
}
String NTPClient::getFormattedTime() {

View File

@ -58,10 +58,10 @@ class NTPClient {
*/
bool forceUpdate();
String getDay();
String getHours();
String getMinutes();
String getSeconds();
int getDay();
int getHours();
int getMinutes();
int getSeconds();
/**
* @return time formatted like `hh:mm:ss`