|
ESPHome 2026.10.0-dev
|
Namespaces | |
| namespace | internal |
Data Structures | |
| class | CronTrigger |
| struct | DSTRule |
| Rule for DST transition (packed for 32-bit: 12 bytes) More... | |
| struct | ParsedTimezone |
| Parsed POSIX timezone information (packed for 32-bit: 32 bytes) More... | |
| class | RealTimeClock |
| The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock. More... | |
| class | SyncTrigger |
| class | TimeHasTimeCondition |
Enumerations | |
| enum class | DSTRuleType : uint8_t { NONE = 0 , MONTH_WEEK_DAY , JULIAN_NO_LEAP , DAY_OF_YEAR } |
| Type of DST transition rule. More... | |
Functions | |
| void | set_global_tz (const ParsedTimezone &tz) |
| Set the global timezone used by epoch_to_local_tm() when called without a timezone. | |
| const ParsedTimezone & | get_global_tz () |
| Get the global timezone. | |
| if (dst_start< dst_end) | |
| void | format_designation (int32_t posix_offset, char *buf, size_t buf_size) |
| Format a POSIX offset as "+HHMM"/"-HHMM" into buf (must be >= 6 bytes). | |
| bool | epoch_to_local_tm (time_t utc_epoch, const ParsedTimezone &tz, struct tm *out_tm) |
| Convert a UTC epoch to local time using the parsed timezone. | |
| bool | is_in_dst (time_t utc_epoch, const ParsedTimezone &tz) |
| Check if a given UTC epoch falls within DST for the parsed timezone. | |
Variables | |
| bool const ParsedTimezone & | tz |
| time_t | dst_start = internal::calculate_dst_transition(year, tz.dst_start, tz.std_offset_seconds) |
| time_t | dst_end = internal::calculate_dst_transition(year, tz.dst_end, tz.dst_offset_seconds) |
| else | |
| ESPTime | __attribute__ ((noinline)) RealTimeClock |
|
strong |
Type of DST transition rule.
Definition at line 11 of file posix_tz.h.
| bool esphome::time::epoch_to_local_tm | ( | time_t | utc_epoch, |
| const ParsedTimezone & | tz, | ||
| struct tm * | out_tm ) |
Convert a UTC epoch to local time using the parsed timezone.
This replaces libc's localtime() to avoid scanf dependency.
| utc_epoch | Unix timestamp in UTC | |
| tz | The parsed timezone | |
| [out] | out_tm | Output tm struct with local time |
Definition at line 268 of file posix_tz.cpp.
| void esphome::time::format_designation | ( | int32_t | posix_offset, |
| char * | buf, | ||
| size_t | buf_size ) |
Format a POSIX offset as "+HHMM"/"-HHMM" into buf (must be >= 6 bytes).
Definition at line 258 of file posix_tz.cpp.
| const ParsedTimezone & esphome::time::get_global_tz | ( | ) |
Get the global timezone.
Definition at line 16 of file posix_tz.cpp.
| esphome::time::if | ( | ) |
Definition at line 247 of file posix_tz.cpp.
| bool esphome::time::is_in_dst | ( | time_t | utc_epoch, |
| const ParsedTimezone & | tz ) |
Check if a given UTC epoch falls within DST for the parsed timezone.
| utc_epoch | Unix timestamp in UTC |
| tz | The parsed timezone |
| void esphome::time::set_global_tz | ( | const ParsedTimezone & | tz | ) |
Set the global timezone used by epoch_to_local_tm() when called without a timezone.
This enables ESPTime::from_epoch_local() to work without libc's localtime().
Definition at line 14 of file posix_tz.cpp.
| bool esphome::time::__attribute__ | ( | (noinline) | ) |
Definition at line 26 of file real_time_clock.cpp.
| time_t esphome::time::dst_end = internal::calculate_dst_transition(year, tz.dst_end, tz.dst_offset_seconds) |
Definition at line 245 of file posix_tz.cpp.
| time_t esphome::time::dst_start = internal::calculate_dst_transition(year, tz.dst_start, tz.std_offset_seconds) |
Definition at line 243 of file posix_tz.cpp.
| esphome::time::else |
Definition at line 250 of file posix_tz.cpp.
| bool const ParsedTimezone& esphome::time::tz |
Definition at line 234 of file posix_tz.cpp.