mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
38e3095e353e69cbfa08494fffaf22c96fa43eea
Since the timezone bloat elimination (#13635) removed setenv("TZ")/tzset() on embedded platforms, libc's ::strftime no longer has access to timezone state for %Z and %z format specifiers. The time values (hour, minute, etc.) are correct since they come from our custom timezone parser via struct tm fields, but %Z and %z read from libc's internal _tzname/_timezone which are stuck at GMT/+0000. Fix by substituting %Z and %z in the format string with the correct "+HHMM"/"-HHMM" designation computed from our parsed timezone offset before passing to ::strftime. The substitution only runs when %Z or %z are present in the format string, so there is no overhead for the common case. Also refactors strftime_to() to delegate to strftime() instead of duplicating the ::strftime call, ensuring both code paths get the fix.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
546 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
