|
ESPHome 2026.5.0-dev
|
Functions | |
| bool | is_leap_year (int year) |
| Check if a year is a leap year. | |
| int | days_in_month (int year, int month) |
| Get the number of days in a month. | |
| int | __attribute__ ((noinline)) day_of_week(int year |
| return ((h+6) % 7) | |
| if (remaining_secs< 0) | |
| while (days >=(dim=days_in_month(year, month))) | |
| bool | skip_tz_name (const char *&p) |
| Skip a timezone name (letters or <...> quoted format) | |
| int32_t | __attribute__ ((noinline)) parse_offset(const char *&p) |
| while (out_month<=12) | |
| bool | parse_dst_rule (const char *&p, DSTRule &rule) |
| Parse a DST rule in format Mm.w.d[/time], Jn[/time], or n[/time]. | |
| for (int m=1;m< month;m++) | |
| switch (rule.type) | |
| int32_t | parse_offset (const char *&p) |
| Parse an offset in format [-]hh[:mm[:ss]]. | |
| void | julian_to_month_day (int julian_day, int &month, int &day) |
| Convert Julian day (J format, 1-365 not counting Feb 29) to month/day. | |
| void | day_of_year_to_month_day (int day_of_year, int year, int &month, int &day) |
| Convert day of year (plain format, 0-365 counting Feb 29) to month/day. | |
| int | day_of_week (int year, int month, int day) |
| Calculate day of week for any date (0 = Sunday) Uses a simplified algorithm that works for years 1970-2099. | |
| void | epoch_to_tm_utc (time_t epoch, struct tm *out_tm) |
| Convert epoch to year/month/day/hour/min/sec (UTC) | |
| time_t | calculate_dst_transition (int year, const DSTRule &rule, int32_t base_offset_seconds) |
| Calculate the epoch timestamp for a DST transition in a given year. | |
Variables | |
| constexpr int | EPOCH_YEAR = 1970 |
| constexpr int | LEAP_YEARS_BEFORE_EPOCH = count_leap_years_up_to(EPOCH_YEAR - 1) |
| constexpr int | DAYS_PER_YEAR = 365 |
| constexpr int | SECONDS_PER_DAY = 86400 |
| int int | month = 1 |
| int int int | day |
| int | j = year / 100 |
| int | h = (day + (13 * (month + 1)) / 5 + k + k / 4 + j / 4 - 2 * j) % 7 |
| void struct tm * | out_tm |
| int32_t | remaining_secs = epoch % SECONDS_PER_DAY |
| out_tm | tm_sec = remaining_secs % 60 |
| out_tm | tm_min = remaining_secs % 60 |
| out_tm | tm_hour = remaining_secs / 60 |
| out_tm | tm_wday = static_cast<int>((days + 4) % 7) |
| int | year = days_to_year(days) |
| out_tm | tm_year = year - 1900 |
| out_tm | tm_yday = static_cast<int>(days) |
| int | dim |
| out_tm | tm_mon = month - 1 |
| out_tm | tm_mday = static_cast<int>(days) + 1 |
| out_tm | tm_isdst = 0 |
| void int & | out_month = 1 |
| void int int & | out_day |
| return | days = days_to_year_start(year) + days_from_year_start(year, month, day) |
| time_t const DSTRule & | rule |
| time_t const DSTRule int32_t | base_offset_seconds |
| time_t esphome::time::internal::__attribute__ | ( | (noinline) | ) |
| int32_t esphome::time::internal::__attribute__ | ( | (noinline) | ) | const & |
Definition at line 165 of file posix_tz.cpp.
| time_t esphome::time::internal::calculate_dst_transition | ( | int | year, |
| const DSTRule & | rule, | ||
| int32_t | base_offset_seconds ) |
Calculate the epoch timestamp for a DST transition in a given year.
| year | The year (e.g., 2026) |
| rule | The DST rule (month, week, day_of_week, time) |
| base_offset_seconds | The timezone offset to apply (std or dst depending on context) |
| int esphome::time::internal::day_of_week | ( | int | year, |
| int | month, | ||
| int | day ) |
Calculate day of week for any date (0 = Sunday) Uses a simplified algorithm that works for years 1970-2099.
| void esphome::time::internal::day_of_year_to_month_day | ( | int | day_of_year, |
| int | year, | ||
| int & | month, | ||
| int & | day ) |
Convert day of year (plain format, 0-365 counting Feb 29) to month/day.
| day_of_year | Day number 0-365 | |
| year | The year (for leap year calculation) | |
| [out] | month | Output: month 1-12 |
| [out] | day | Output: day of month |
| int esphome::time::internal::days_in_month | ( | int | year, |
| int | month ) |
Get the number of days in a month.
Definition at line 78 of file posix_tz.cpp.
| void esphome::time::internal::epoch_to_tm_utc | ( | time_t | epoch, |
| struct tm * | out_tm ) |
Convert epoch to year/month/day/hour/min/sec (UTC)
| esphome::time::internal::for | ( | ) |
Definition at line 295 of file posix_tz.cpp.
| esphome::time::internal::if | ( | ) |
Definition at line 110 of file posix_tz.cpp.
| bool esphome::time::internal::is_leap_year | ( | int | year | ) |
Check if a year is a leap year.
Definition at line 32 of file posix_tz.cpp.
| void esphome::time::internal::julian_to_month_day | ( | int | julian_day, |
| int & | month, | ||
| int & | day ) |
Convert Julian day (J format, 1-365 not counting Feb 29) to month/day.
| julian_day | Day number 1-365 | |
| [out] | month | Output: month 1-12 |
| [out] | day | Output: day of month |
| bool esphome::time::internal::parse_dst_rule | ( | const char *& | p, |
| DSTRule & | rule ) |
Parse a DST rule in format Mm.w.d[/time], Jn[/time], or n[/time].
| p | Pointer to current position, updated on return |
| rule | Output: the parsed rule |
Definition at line 239 of file posix_tz.cpp.
| int32_t esphome::time::internal::parse_offset | ( | const char *& | p | ) |
Parse an offset in format [-]hh[:mm[:ss]].
| p | Pointer to current position, updated on return |
| esphome::time::internal::return | ( | (h+6) % | 7 | ) |
| bool esphome::time::internal::skip_tz_name | ( | const char *& | p | ) |
Skip a timezone name (letters or <...> quoted format)
| p | Pointer to current position, updated on return |
Definition at line 143 of file posix_tz.cpp.
| esphome::time::internal::switch | ( | rule. | type | ) |
Definition at line 304 of file posix_tz.cpp.
| esphome::time::internal::while | ( | days >= | dim=days_in_month(year, month) | ) |
Definition at line 133 of file posix_tz.cpp.
| esphome::time::internal::while | ( | out_month<= | 12 | ) |
Definition at line 205 of file posix_tz.cpp.
| return days *SECONDS_PER_DAY rule time_seconds esphome::time::internal::base_offset_seconds |
Definition at line 301 of file posix_tz.cpp.
| static int int int esphome::time::internal::day |
| int64_t esphome::time::internal::days = days_to_year_start(year) + days_from_year_start(year, month, day) |
Definition at line 298 of file posix_tz.cpp.
|
constexpr |
Definition at line 42 of file posix_tz.cpp.
| int esphome::time::internal::dim |
Definition at line 132 of file posix_tz.cpp.
|
constexpr |
Definition at line 40 of file posix_tz.cpp.
Definition at line 101 of file posix_tz.cpp.
| int esphome::time::internal::j = year / 100 |
Definition at line 100 of file posix_tz.cpp.
|
constexpr |
Definition at line 41 of file posix_tz.cpp.
| static int int esphome::time::internal::month = 1 |
Definition at line 93 of file posix_tz.cpp.
| void int int int & esphome::time::internal::out_day |
Definition at line 199 of file posix_tz.cpp.
| void int int & esphome::time::internal::out_month = 1 |
Definition at line 199 of file posix_tz.cpp.
| void struct tm* esphome::time::internal::out_tm |
Definition at line 106 of file posix_tz.cpp.
| esphome::time::internal::remaining_secs = epoch % SECONDS_PER_DAY |
Definition at line 109 of file posix_tz.cpp.
| time_t const DSTRule& esphome::time::internal::rule |
Definition at line 301 of file posix_tz.cpp.
|
constexpr |
Definition at line 43 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_hour = remaining_secs / 60 |
Definition at line 118 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_isdst = 0 |
Definition at line 140 of file posix_tz.cpp.
Definition at line 139 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_min = remaining_secs % 60 |
Definition at line 117 of file posix_tz.cpp.
Definition at line 138 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_sec = remaining_secs % 60 |
Definition at line 115 of file posix_tz.cpp.
Definition at line 121 of file posix_tz.cpp.
Definition at line 128 of file posix_tz.cpp.
Definition at line 127 of file posix_tz.cpp.
| void int esphome::time::internal::year = days_to_year(days) |
Definition at line 126 of file posix_tz.cpp.