From fe79989b8b339bd6ba558265a32ab7a1fc25e9ea Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Mon, 18 Apr 2016 15:08:38 -0400 Subject: [PATCH] Change return type of get components to int --- NTPClient.cpp | 16 ++++++++-------- NTPClient.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/NTPClient.cpp b/NTPClient.cpp index 075c7ba..9f25d55 100644 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -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() { diff --git a/NTPClient.h b/NTPClient.h index 8221329..9b856de 100644 --- a/NTPClient.h +++ b/NTPClient.h @@ -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`