diff options
Diffstat (limited to 'watch-library/shared/watch/watch_utility.c')
-rw-r--r-- | watch-library/shared/watch/watch_utility.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/watch-library/shared/watch/watch_utility.c b/watch-library/shared/watch/watch_utility.c index dd11c0eb..3f8aa619 100644 --- a/watch-library/shared/watch/watch_utility.c +++ b/watch-library/shared/watch/watch_utility.c @@ -151,6 +151,17 @@ watch_date_time watch_utility_date_time_convert_zone(watch_date_time date_time, return watch_utility_date_time_from_unix_time(timestamp, destination_utc_offset); } +watch_duration_t watch_utility_seconds_to_duration(uint32_t seconds) { + watch_duration_t retval; + + retval.seconds = (seconds % 60); + retval.minutes = (seconds % 3600) / 60; + retval.hours = (seconds % 86400) / 3600; + retval.days = seconds / 86400; + + return retval; +} + bool watch_utility_convert_to_12_hour(watch_date_time *date_time) { bool is_pm = date_time->unit.hour > 11; date_time->unit.hour %= 12; |