Time now auto-updates with DST

This commit is contained in:
David Volovskiy
2024-08-02 01:23:21 -04:00
parent 2ce07f9539
commit 149911e4ad
7 changed files with 105 additions and 16 deletions

View File

@@ -45,6 +45,13 @@ typedef struct {
uint32_t days; // 0-4294967295
} watch_duration_t;
typedef enum {
DST_STARTED,
DST_OCCURRING,
DST_ENDING,
DST_ENDED
} dst_t;
/** @brief Returns a two-letter weekday for the given timestamp, suitable for display
* in positions 0-1 of the watch face
* @param date_time The watch_date_time whose weekday you want.
@@ -78,6 +85,12 @@ uint16_t watch_utility_days_since_new_year(uint16_t year, uint8_t month, uint8_t
*/
uint8_t is_leap(uint16_t year);
/** @brief Returns off of dst_t based off if DST is occurring, srted, ended, or none of those.
* @param date_time The watch_date_time that you wish to convert.
* @return DST_OCCURRING, DST_HAPPENING, DST_ENDING, DST_ENDED
*/
uint8_t is_dst(watch_date_time date_time);
/** @brief Returns the UNIX time (seconds since 1970) for a given date/time in UTC.
* @param date_time The watch_date_time that you wish to convert.
* @param year The year of the date you wish to convert.