|
PebbleOS
|
Read access to the timezone database stored in resources. More...
Data Structures | |
| struct | TimezoneDSTRule |
| Transition between standard time and DST. More... | |
Enumerations | |
| enum | DSTRuleFlags { TIMEZONE_FLAG_DAY_DECREMENT = 1 << 0 , TIMEZONE_FLAG_STANDARD_TIME = 1 << 1 , TIMEZONE_FLAG_UTC_TIME = 1 << 2 } |
| Flags of a TimezoneDSTRule. More... | |
Functions | |
| int | timezone_database_get_region_count (void) |
| Get the number of regions in the database. | |
| bool | timezone_database_load_region_info (uint16_t region_id, TimezoneInfo *tz_info) |
| Load the timezone information of a region. | |
| bool | timezone_database_load_region_name (uint16_t region_id, char *region_name) |
| Load the name of a region. | |
| bool | timezone_database_load_dst_rule (uint8_t dst_id, TimezoneDSTRule *start, TimezoneDSTRule *end) |
| Load the pair of DST rules of a DST id. | |
| int | timezone_database_find_region_by_name (const char *region_name, int region_name_length) |
| Find a region by name. | |
Read access to the timezone database stored in resources.
The database holds the regions (continent/city name, UTC offset, abbreviation and DST rule index), pairs of DST rules, and links mapping legacy region names to regions.
| struct TimezoneDSTRule |
Transition between standard time and DST.
Matches the storage format exactly; do not change it without changing the database format.
| enum DSTRuleFlags |
Flags of a TimezoneDSTRule.
| Enumerator | |
|---|---|
| TIMEZONE_FLAG_DAY_DECREMENT | Search backwards, rather than forwards, from TimezoneDSTRule::mday for the weekday. |
| TIMEZONE_FLAG_STANDARD_TIME | The transition time is in standard time rather than wall-clock time. |
| TIMEZONE_FLAG_UTC_TIME | The transition time is in UTC rather than wall-clock time. |
| int timezone_database_find_region_by_name | ( | const char * | region_name, |
| int | region_name_length | ||
| ) |
Find a region by name.
Region names are matched on their first region_name_length characters. Links are searched next, as phones may send legacy names such as "US/Pacific".
| region_name | Name to look up, need not be NUL terminated. |
| region_name_length | Length of region_name. |
| int timezone_database_get_region_count | ( | void | ) |
Get the number of regions in the database.
| bool timezone_database_load_dst_rule | ( | uint8_t | dst_id, |
| TimezoneDSTRule * | start, | ||
| TimezoneDSTRule * | end | ||
| ) |
Load the pair of DST rules of a DST id.
| dst_id | DST rule index, starting at 1. | |
| [out] | start | Rule entering DST. |
| [out] | end | Rule leaving DST. |
dst_id is invalid, the timezone does not observe DST or the database is malformed. | bool timezone_database_load_region_info | ( | uint16_t | region_id, |
| TimezoneInfo * | tz_info | ||
| ) |
Load the timezone information of a region.
TimezoneInfo::dst_start and TimezoneInfo::dst_end are set to 0; the DST period is not computed.
| region_id | Region to look up. | |
| [out] | tz_info | Timezone information. |
| bool timezone_database_load_region_name | ( | uint16_t | region_id, |
| char * | region_name | ||
| ) |
Load the name of a region.
| region_id | Region to look up. | |
| [out] | region_name | NUL terminated "continent/city" name, in a buffer of at least TIMEZONE_NAME_LENGTH bytes. |
region_id is invalid.