Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
timezone APIs

timezone API More...

Functions

static int8_t utc_timezone_location_approximate (int32_t longitude)
 Calculate the approximate UTC timezone of a location.
 

Detailed Description

timezone API

Function Documentation

◆ utc_timezone_location_approximate()

static int8_t utc_timezone_location_approximate ( int32_t longitude)
inlinestatic

#include <infuse/time/timezone.h>

Calculate the approximate UTC timezone of a location.

This function splits the earth into 15 degree longitude chunks to approximate the timezone without requiring any information other than the location. Due to the vagaries of actual time-zones, the true timezone offset may differ from this value by up to 3 hours (Western China).

Parameters
longitudeLongitude (scaled by 1e7)
Returns
int8_t Approximate timezone offset in hours