From 30477c764d9353381ef6e8bf186bae703cffbc7f Mon Sep 17 00:00:00 2001 From: Krzysztof Zdulski Date: Fri, 29 Nov 2024 22:05:00 +0100 Subject: [PATCH] Fix recalc_timestamp_utc (#7894) --- esphome/core/time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/time.cpp b/esphome/core/time.cpp index 31977d972b..66a0e1c0a7 100644 --- a/esphome/core/time.cpp +++ b/esphome/core/time.cpp @@ -169,7 +169,7 @@ void ESPTime::recalc_timestamp_utc(bool use_day_of_year) { } for (int i = 1970; i < this->year; i++) - res += (year % 4 == 0) ? 366 : 365; + res += (i % 4 == 0) ? 366 : 365; if (use_day_of_year) { res += this->day_of_year - 1;