Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
timezone.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_TIME_TIMEZONE_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_TIME_TIMEZONE_H_
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
25
38static inline int8_t utc_timezone_location_approximate(int32_t longitude)
39{
40 int32_t rounding = longitude > 0 ? 75000000 : -75000000;
41
42 return (longitude + rounding) / 150000000;
43}
44
57static inline int16_t utc_timezone_minutes_location_approximate(int32_t longitude)
58{
59 int32_t rounding = longitude > 0 ? 1250000 : -1250000;
60
61 return (longitude + rounding) / 2500000;
62}
63
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif /* INFUSE_SDK_INCLUDE_INFUSE_TIME_TIMEZONE_H_ */
static int8_t utc_timezone_location_approximate(int32_t longitude)
Calculate the approximate UTC timezone of a location.
Definition timezone.h:38
static int16_t utc_timezone_minutes_location_approximate(int32_t longitude)
Calculate the approximate UTC timezone of a location in minutes.
Definition timezone.h:57