From 9628c213b5971c10bd2bc52617e145b0b635e507 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 30 Jan 2026 01:01:21 -0600 Subject: [PATCH] make human readable --- esphome/components/time/real_time_clock.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/esphome/components/time/real_time_clock.cpp b/esphome/components/time/real_time_clock.cpp index c98dfb9b52..4aa8e3fd71 100644 --- a/esphome/components/time/real_time_clock.cpp +++ b/esphome/components/time/real_time_clock.cpp @@ -27,10 +27,14 @@ void RealTimeClock::dump_config() { #ifdef USE_TIME_TIMEZONE const auto &tz = get_global_tz(); // POSIX offset is positive west, negate for conventional UTC+X display + int std_h = -tz.std_offset_seconds / 3600; + int std_m = (std::abs(tz.std_offset_seconds) % 3600) / 60; if (tz.has_dst) { - ESP_LOGCONFIG(TAG, "Timezone: UTC%+d (DST UTC%+d)", -tz.std_offset_seconds / 3600, -tz.dst_offset_seconds / 3600); + int dst_h = -tz.dst_offset_seconds / 3600; + int dst_m = (std::abs(tz.dst_offset_seconds) % 3600) / 60; + ESP_LOGCONFIG(TAG, "Timezone: UTC%+d:%02d (DST UTC%+d:%02d)", std_h, std_m, dst_h, dst_m); } else { - ESP_LOGCONFIG(TAG, "Timezone: UTC%+d", -tz.std_offset_seconds / 3600); + ESP_LOGCONFIG(TAG, "Timezone: UTC%+d:%02d", std_h, std_m); } #endif auto time = this->now();