25#ifndef _WATCH_UTILITY_H_INCLUDED
26#define _WATCH_UTILITY_H_INCLUDED
32#define use_iso_8601_weeknumber 0
uint32_t watch_utility_offset_timestamp(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds)
Offset a timestamp by a given amount.
Definition: watch_utility.c:243
uint8_t watch_utility_get_weeknumber(uint16_t year, uint8_t month, uint8_t day)
Returns a number between 1-53 representing the weeknumber according to ISO8601 : First week of the ye...
Definition: watch_utility.c:45
float watch_utility_thermistor_temperature(uint16_t value, bool highside, float b_coefficient, float nominal_temperature, float nominal_resistance, float series_resistance)
Returns a temperature in degrees Celsius for a given thermistor voltage divider circuit.
Definition: watch_utility.c:223
uint8_t watch_utility_get_iso8601_weekday_number(uint16_t year, uint8_t month, uint8_t day)
Returns a number between 1-7 representing the weekday according to ISO8601 : week starts on Monday an...
Definition: watch_utility.c:34
uint16_t watch_utility_days_since_new_year(uint16_t year, uint8_t month, uint8_t day)
Returns a number between 1-366 representing the elapsed days since January 1st the same year.
Definition: watch_utility.c:86
watch_date_time watch_utility_date_time_from_unix_time(uint32_t timestamp, uint32_t utc_offset)
Returns a watch_date_time struct for a given UNIX time and UTC offset.
Definition: watch_utility.c:130
bool watch_utility_convert_to_12_hour(watch_date_time *date_time)
Converts a watch_date_time for 12-hour display.
Definition: watch_utility.c:216
watch_duration_t watch_utility_seconds_to_duration(uint32_t seconds)
Converts a duration in seconds to a watch_duration_t struct.
Definition: watch_utility.c:205
watch_date_time watch_utility_date_time_convert_zone(watch_date_time date_time, uint32_t origin_utc_offset, uint32_t destination_utc_offset)
Converts a time from a given time zone to another time zone.
Definition: watch_utility.c:200
uint32_t watch_utility_convert_to_unix_time(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t utc_offset)
Returns the UNIX time (seconds since 1970) for a given date/time in UTC.
Definition: watch_utility.c:105
const char * watch_utility_get_weekday(watch_date_time date_time)
Returns a two-letter weekday for the given timestamp, suitable for display in positions 0-1 of the wa...
Definition: watch_utility.c:28
uint8_t is_leap(uint16_t year)
Returns 1 if year is leap and 0 otherwise.
Definition: watch_utility.c:80
uint32_t watch_utility_date_time_to_unix_time(watch_date_time date_time, uint32_t utc_offset)
Returns the UNIX time (seconds since 1970) for a given watch_date_time struct.
Definition: watch_utility.c:120
Definition: watch_utility.h:41
Definition: watch_rtc.h:44