2022-10-12 02:01:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2022-11-17 19:33:31 +00:00
|
|
|
/**
|
|
|
|
* @brief Calculates timezone offset in seconds given timezone offset in hours.
|
|
|
|
* @param hours timezone offset in hours
|
|
|
|
* @return Timezone offset in seconds.
|
|
|
|
*/
|
2022-10-12 02:01:37 +00:00
|
|
|
int32_t timezone_offset_from_hours(float hours);
|
2022-11-17 19:33:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Applies timezone offset to a given time.
|
|
|
|
* @param time time to apply offset to.
|
|
|
|
* @param offset timezone offset in seconds.
|
|
|
|
* @return Time with timezone offset applied.
|
|
|
|
*/
|
2022-10-12 02:01:37 +00:00
|
|
|
uint64_t timezone_offset_apply(uint64_t time, int32_t offset);
|