You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
The method getUTCEpochMillis() does not return the full 64 bits of the unsigned long long.
The compiler doesn't convert _currentEpoc to unsigned long long and discards all the bits after the 32-bit value when calculating.
I fixed this by explicitly casting _currentEpoc to unsigned long long.
Fix in NTPClient_Generic_Impl.h:
unsigned long long NTPClient::getUTCEpochMillis()
{
unsigned long long epoch;
epoch = (unsigned long long)this->_currentEpoc * 1000; // last time returned via server in millis
epoch += (this->_currentFraction) / FRACTIONSPERMILLI; // add the fraction from the server
epoch += millis() - this->_lastUpdate; // add the millis that have passed since the last update
return epoch;
}
Additional Info:
IDE: Visual Studio 2022 with Visual Micro (with Arduino 1.6/1.8).
ESP32 Core Version: 1.0.6
Arduino IDE version: 1.8.19
OS: Windows 10 Home
The text was updated successfully, but these errors were encountered:
The method getUTCEpochMillis() does not return the full 64 bits of the unsigned long long.
The compiler doesn't convert _currentEpoc to unsigned long long and discards all the bits after the 32-bit value when calculating.
I fixed this by explicitly casting _currentEpoc to unsigned long long.
Fix in NTPClient_Generic_Impl.h:
Additional Info:
The text was updated successfully, but these errors were encountered: