Fixed sunrise/set UTC offset
This commit is contained in:
parent
96422de031
commit
2ac90bbb96
@ -420,7 +420,7 @@ void calculateSunriseAndSunset() {
|
|||||||
// there is a sunrise
|
// there is a sunrise
|
||||||
tim_0.tm_hour = minUTC / 60;
|
tim_0.tm_hour = minUTC / 60;
|
||||||
tim_0.tm_min = 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));
|
DEBUG_PRINTF("Sunrise: %02d:%02d\n", hour(sunrise), minute(sunrise));
|
||||||
} else {
|
} else {
|
||||||
sunrise = 0;
|
sunrise = 0;
|
||||||
@ -431,7 +431,7 @@ void calculateSunriseAndSunset() {
|
|||||||
// there is a sunset
|
// there is a sunset
|
||||||
tim_0.tm_hour = minUTC / 60;
|
tim_0.tm_hour = minUTC / 60;
|
||||||
tim_0.tm_min = 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));
|
DEBUG_PRINTF("Sunset: %02d:%02d\n", hour(sunset), minute(sunset));
|
||||||
} else {
|
} else {
|
||||||
sunset = 0;
|
sunset = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user