|
ESPHome 2026.3.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) | |
| 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 | |
| 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 % 86400 |
| 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) | ) |
Definition at line 285 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 59 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 276 of file posix_tz.cpp.
| esphome::time::internal::if | ( | ) |
Definition at line 91 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 31 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 220 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 124 of file posix_tz.cpp.
| esphome::time::internal::switch | ( | rule. | type | ) |
Definition at line 296 of file posix_tz.cpp.
| esphome::time::internal::while | ( | days >= | dim=days_in_month(year, month) | ) |
Definition at line 114 of file posix_tz.cpp.
| esphome::time::internal::while | ( | out_month<= | 12 | ) |
Definition at line 186 of file posix_tz.cpp.
Definition at line 293 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 279 of file posix_tz.cpp.
| int esphome::time::internal::dim |
Definition at line 113 of file posix_tz.cpp.
Definition at line 82 of file posix_tz.cpp.
| int esphome::time::internal::j = year / 100 |
Definition at line 81 of file posix_tz.cpp.
| static int int esphome::time::internal::month = 1 |
Definition at line 74 of file posix_tz.cpp.
| void int int int & esphome::time::internal::out_day |
Definition at line 180 of file posix_tz.cpp.
| void int int & esphome::time::internal::out_month = 1 |
Definition at line 180 of file posix_tz.cpp.
| void struct tm* esphome::time::internal::out_tm |
Definition at line 87 of file posix_tz.cpp.
| esphome::time::internal::remaining_secs = epoch % 86400 |
Definition at line 90 of file posix_tz.cpp.
| time_t const DSTRule& esphome::time::internal::rule |
Definition at line 293 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_hour = remaining_secs / 60 |
Definition at line 99 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_isdst = 0 |
Definition at line 121 of file posix_tz.cpp.
Definition at line 120 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_min = remaining_secs % 60 |
Definition at line 98 of file posix_tz.cpp.
Definition at line 119 of file posix_tz.cpp.
| out_tm esphome::time::internal::tm_sec = remaining_secs % 60 |
Definition at line 96 of file posix_tz.cpp.
Definition at line 102 of file posix_tz.cpp.
Definition at line 109 of file posix_tz.cpp.
Definition at line 108 of file posix_tz.cpp.
| void int esphome::time::internal::year = days_to_year(days) |
Definition at line 107 of file posix_tz.cpp.