From 197dd332b17d8b7a77d90ef7a339ff805159af14 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 19 Mar 2026 18:47:45 -1000 Subject: [PATCH] [time] Fix timezone_offset() and recalc_timestamp_local() always using UTC fallback time.h was missing #include "esphome/core/defines.h", so USE_TIME_TIMEZONE was never defined when compiling time.cpp. Both functions always took the #else path, returning 0 offset and treating local time as UTC. --- esphome/core/time.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/core/time.h b/esphome/core/time.h index 874f0db4b4..1716c51ffd 100644 --- a/esphome/core/time.h +++ b/esphome/core/time.h @@ -1,5 +1,7 @@ #pragma once +#include "esphome/core/defines.h" + #include #include #include