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.
static int16_t utc_timezone_minutes_location_approximate (int32_t longitude)
 Calculate the approximate UTC timezone of a location in minutes.

Detailed Description

timezone API

Function Documentation

◆ utc_timezone_location_approximate()

int8_t utc_timezone_location_approximate ( int32_t longitude)
inlinestatic

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/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

◆ utc_timezone_minutes_location_approximate()

int16_t utc_timezone_minutes_location_approximate ( int32_t longitude)
inlinestatic

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/time/timezone.h>

Calculate the approximate UTC timezone of a location in minutes.

This function splits the earth into 15 minute 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
int16_t Approximate timezone offset in minutes