From e1df75fc9b1e4fb618cf31ad7e21fe159b6e8d1e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Jan 2026 21:53:06 -0600 Subject: [PATCH] tweak --- esphome/components/time/posix_tz.cpp | 3 +-- esphome/components/time/posix_tz.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/time/posix_tz.cpp b/esphome/components/time/posix_tz.cpp index 02f47d3a7d..1186b3064c 100644 --- a/esphome/components/time/posix_tz.cpp +++ b/esphome/components/time/posix_tz.cpp @@ -160,8 +160,7 @@ static void parse_transition_time(const char *&p, DSTRule &rule) { } } -void julian_to_month_day(int julian_day, int year, int &out_month, int &out_day) { - (void) year; // Unused - J format ignores leap years by design +void julian_to_month_day(int julian_day, int &out_month, int &out_day) { // J format: day 1-365, Feb 29 is NOT counted even in leap years // So day 60 is always March 1 static const int DAYS_BEFORE_MONTH[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; diff --git a/esphome/components/time/posix_tz.h b/esphome/components/time/posix_tz.h index 7880d52f8d..70f2a84851 100644 --- a/esphome/components/time/posix_tz.h +++ b/esphome/components/time/posix_tz.h @@ -94,10 +94,9 @@ bool parse_dst_rule(const char *&p, DSTRule &rule); /// Convert Julian day (J format, 1-365 not counting Feb 29) to month/day /// @param julian_day Day number 1-365 -/// @param year The year (for leap year calculation) /// @param[out] month Output: month 1-12 /// @param[out] day Output: day of month -void julian_to_month_day(int julian_day, int year, int &month, int &day); +void julian_to_month_day(int julian_day, int &month, int &day); /// Convert day of year (plain format, 0-365 counting Feb 29) to month/day /// @param day_of_year Day number 0-365