From 98b3320fbe302ae2ed6884fb023a571f6bba066a Mon Sep 17 00:00:00 2001 From: Driver55 Date: Sun, 22 Jul 2018 21:34:20 +0200 Subject: [PATCH] Update for OpenWeatherMapForecast.cpp According to the openweathermap.org API documentation, the "ObservationTime" parameter refers to UTC time and therefore should not be converted to localtime. See https://github.com/ThingPulse/esp8266-weather-station/issues/125 --- src/OpenWeatherMapForecast.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenWeatherMapForecast.cpp b/src/OpenWeatherMapForecast.cpp index 485c963..a838136 100644 --- a/src/OpenWeatherMapForecast.cpp +++ b/src/OpenWeatherMapForecast.cpp @@ -104,7 +104,7 @@ void OpenWeatherMapForecast::value(String value) { if (allowedHoursCount > 0) { time_t time = data[currentForecast].observationTime; struct tm* timeInfo; - timeInfo = localtime(&time); + timeInfo = gmtime(&time); uint8_t currentHour = timeInfo->tm_hour; for (uint8_t i = 0; i < allowedHoursCount; i++) { if (currentHour == allowedHours[i]) {