SensorsIot / NTPtimeESP

Small library for ESP8266 which returns the actual time adjusted by time zone and summer time
232 stars 65 forks source link

Getting valid flag is true and time is wrong! #32

Open waged opened 3 years ago

waged commented 3 years ago

My ESP32 Wrover one time per 10 get the wrong time like "2036-2-7T6:28:16" although i check the strDateTime.isValid and it's true. the router NTP time is correct and never sending the wrong time but it could be little slow.

NTPtime NTPch("pool.ntp.org"); NTPch.setRecvTimeout(5); dateTime = NTPch.getNTPtime(0.0, 0); if (dateTime.valid) { actualHours = dateTime.hour; actualMinutes = dateTime.minute; actualSeconds = dateTime.second; actualYear = dateTime.year; actualMonth = dateTime.month; actualDays = dateTime.day; Serial.printf("Year: %d, Month: %d, Day: %d, Hours: %d, Minutes: %d \n", actualYear, actualMonth, actualDays, actualHours, actualMinutes); }

KieranSteyn commented 6 months ago

Same issue. Any workaround?