String WundergroundClient::getMinutes() { if (localEpoc == 0) { return "--"; } int minutes = ((getCurrentEpoch() % 3600) / 60); if (minutes < 10 ) { // In the first 10 minutes of each hour, we'll want a leading '0' return "0" + String(minutes); } return String(minutes); }
String WundergroundClient::getSeconds() { if (localEpoc == 0) { return "--"; } int seconds = getCurrentEpoch() % 60; if ( seconds < 10 ) { // In the first 10 seconds of each minute, we'll want a leading '0' return "0" + String(seconds); } return String(seconds); }
String WundergroundClient::getHours() { if (localEpoc == 0) { return "--"; } int hours = (getCurrentEpoch() % 86400L) / 3600 + gmtOffset; if (hours < 10) { return "0" + String(hours); } return String(hours); // print the hour (86400 equals secs per day) }
long TimeClient::getCurrentEpochWithUtcOffset() { return round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L) % 86400L; }