From 2ac90bbb961e039120a95c14ec1b1f9b875734c0 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Mon, 27 Sep 2021 14:20:21 +0200 Subject: [PATCH] Fixed sunrise/set UTC offset --- wled00/ntp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/ntp.cpp b/wled00/ntp.cpp index 4014e1fbc..f667ec940 100644 --- a/wled00/ntp.cpp +++ b/wled00/ntp.cpp @@ -420,7 +420,7 @@ void calculateSunriseAndSunset() { // there is a sunrise tim_0.tm_hour = minUTC / 60; tim_0.tm_min = minUTC % 60; - sunrise = tz->toLocal(mktime(&tim_0) - utcOffsetSecs); + sunrise = tz->toLocal(mktime(&tim_0) + utcOffsetSecs); DEBUG_PRINTF("Sunrise: %02d:%02d\n", hour(sunrise), minute(sunrise)); } else { sunrise = 0; @@ -431,7 +431,7 @@ void calculateSunriseAndSunset() { // there is a sunset tim_0.tm_hour = minUTC / 60; tim_0.tm_min = minUTC % 60; - sunset = tz->toLocal(mktime(&tim_0) - utcOffsetSecs); + sunset = tz->toLocal(mktime(&tim_0) + utcOffsetSecs); DEBUG_PRINTF("Sunset: %02d:%02d\n", hour(sunset), minute(sunset)); } else { sunset = 0;