| 150 | } |
| 151 | |
| 152 | String NTPClient::getFormattedTime() const { |
| 153 | unsigned long rawTime = this->getEpochTime(); |
| 154 | unsigned long hours = (rawTime % 86400L) / 3600; |
| 155 | String hoursStr = hours < 10 ? "0" + String(hours) : String(hours); |
| 156 | |
| 157 | unsigned long minutes = (rawTime % 3600) / 60; |
| 158 | String minuteStr = minutes < 10 ? "0" + String(minutes) : String(minutes); |
| 159 | |
| 160 | unsigned long seconds = rawTime % 60; |
| 161 | String secondStr = seconds < 10 ? "0" + String(seconds) : String(seconds); |
| 162 | |
| 163 | return hoursStr + ":" + minuteStr + ":" + secondStr; |
| 164 | } |
| 165 | |
| 166 | void NTPClient::end() { |
| 167 | this->_udp->stop(); |
nothing calls this directly
no test coverage detected