forked from airgradienthq/arduino
Add esp32 timestamp to dashboard page
Hotfix timestamp off by 17 minutes when set system time
This commit is contained in:
+2
-1
@@ -89,8 +89,9 @@ String AirGradient::deviceId(void) {
|
||||
void AirGradient::setCurrentTime(long epochTime) {
|
||||
// set current day/time
|
||||
struct timeval tv;
|
||||
tv.tv_sec = epochTime;
|
||||
tv.tv_sec = epochTime - 1020; // 17 minutes // don't know why it always off by 17 minutes
|
||||
settimeofday(&tv, NULL);
|
||||
Serial.println(epochTime);
|
||||
Serial.printf("Set current time to %s\n", getCurrentTime().c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user