Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
timezone.h File Reference

Go to the source code of this file.

Data Structures

struct  _TIME_ZONE_INFORMATION
struct  _TIMEZONE_DATA
struct  _TIMEZONE_ENTRY

Macros

#define TIME_ZONE_ID_UNKNOWN   0
#define TIME_ZONE_ID_STANDARD   1
#define TIME_ZONE_ID_DAYLIGHT   2
#define TIME_ZONE_ID_INVALID   (DWORD)0xFFFFFFFF
#define TIMEZONE_SIGNATURE   0xED9A1BC3
#define TIMEZONE_NAME_LENGTH   SIZE_64
 Length of timezone name.
#define TIMEZONE_DESC_LENGTH   SIZE_128
 Length of timezone description.

Typedefs

typedef struct _TIME_ZONE_INFORMATION TIME_ZONE_INFORMATION
typedef struct _TIMEZONE_DATA TIMEZONE_DATA
typedef struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
typedef uint32_t STDCALL(* timezone_enumerate_cb) (TIMEZONE_ENTRY *timezone, void *data)

Functions

uint32_t STDCALL timezone_add (TIMEZONE_DATA *data, BOOL _default)
 Add a Timezone from a timezone data block and to the Timezone table.
uint32_t STDCALL timezone_delete (TIMEZONE_ENTRY *timezone)
uint32_t STDCALL timezone_get_name (TIMEZONE_ENTRY *timezone, char *name, uint32_t len)
uint32_t STDCALL timezone_get_description (TIMEZONE_ENTRY *timezone, char *description, uint32_t len)
int32_t STDCALL timezone_get_bias (TIMEZONE_ENTRY *timezone)
uint32_t STDCALL timezone_get_state (TIMEZONE_ENTRY *timezone)
 Get the state of the supplied Timezone at the current date and time.
uint32_t STDCALL timezone_get_state_ex (TIMEZONE_ENTRY *timezone, double_t datetime)
 Get the state of the supplied Timezone at the specified date and time.
int32_t STDCALL timezone_get_active_bias (TIMEZONE_ENTRY *timezone)
 Get the bias (offset between UTC and Local) of the supplied Timezone at the current date and time.
int32_t STDCALL timezone_get_active_bias_ex (TIMEZONE_ENTRY *timezone, double_t datetime)
 Get the bias (offset between UTC and Local) of the supplied Timezone at the specified date and time.
uint32_t STDCALL timezone_get_standard_name (TIMEZONE_ENTRY *timezone, char *name, uint32_t len)
int32_t STDCALL timezone_get_standard_bias (TIMEZONE_ENTRY *timezone)
double_t STDCALL timezone_get_standard_date (TIMEZONE_ENTRY *timezone, BOOL next)
SYSTEMTIME STDCALL timezone_get_standard_start (TIMEZONE_ENTRY *timezone)
uint32_t STDCALL timezone_get_daylight_name (TIMEZONE_ENTRY *timezone, char *name, uint32_t len)
int32_t STDCALL timezone_get_daylight_bias (TIMEZONE_ENTRY *timezone)
double_t STDCALL timezone_get_daylight_date (TIMEZONE_ENTRY *timezone, BOOL next)
SYSTEMTIME STDCALL timezone_get_daylight_start (TIMEZONE_ENTRY *timezone)
TIMEZONE_ENTRY *STDCALL timezone_find (const char *name)
TIMEZONE_ENTRY *STDCALL timezone_find_by_standard (const char *standardname)
TIMEZONE_ENTRY *STDCALL timezone_find_by_daylight (const char *daylightname)
uint32_t STDCALL timezone_enumerate (timezone_enumerate_cb callback, void *data)
uint32_t STDCALL timezone_get_count (void)
 Get the current timezone count.
TIMEZONE_ENTRY *STDCALL timezone_get_default (void)
 Get the current default timezone.
uint32_t STDCALL timezone_set_default (TIMEZONE_ENTRY *timezone)
 Set the current default timezone.
TIMEZONE_ENTRY *STDCALL timezone_check (TIMEZONE_ENTRY *timezone)
 Check if the supplied Timezone is in the Timezone table.
uint32_t STDCALL timezone_update_offset (void)
uint32_t STDCALL timezone_update_environment (void)
 Update the TZ environment variable to represent the current timezone.
uint32_t STDCALL timezone_calculate_offset (double_t datetime, int32_t *offset, BOOL *daylight)
 Calculate the Timezone Offset at the given date and time in the current timezone.
double_t STDCALL timezone_start_to_date_time (SYSTEMTIME *start, uint16_t year)
 Calculate the start date and time from the start date of a timezone.
uint32_t STDCALL timezone_start_to_description (SYSTEMTIME *start, char *description, uint32_t len)
 Get the description of the start date of a timezone.

Macro Definition Documentation

◆ TIME_ZONE_ID_UNKNOWN

#define TIME_ZONE_ID_UNKNOWN   0

Timezone specific constants

◆ TIME_ZONE_ID_STANDARD

#define TIME_ZONE_ID_STANDARD   1

◆ TIME_ZONE_ID_DAYLIGHT

#define TIME_ZONE_ID_DAYLIGHT   2

◆ TIME_ZONE_ID_INVALID

#define TIME_ZONE_ID_INVALID   (DWORD)0xFFFFFFFF

◆ TIMEZONE_SIGNATURE

#define TIMEZONE_SIGNATURE   0xED9A1BC3

Timezone Signature

◆ TIMEZONE_NAME_LENGTH

#define TIMEZONE_NAME_LENGTH   SIZE_64

Length of timezone name.

Timezone name constants

◆ TIMEZONE_DESC_LENGTH

#define TIMEZONE_DESC_LENGTH   SIZE_128

Length of timezone description.

Typedef Documentation

◆ TIME_ZONE_INFORMATION

Timezone specific types Timezone types

◆ TIMEZONE_DATA

typedef struct _TIMEZONE_DATA TIMEZONE_DATA

Timezone Data

◆ TIMEZONE_ENTRY

◆ timezone_enumerate_cb

typedef uint32_t STDCALL(* timezone_enumerate_cb) (TIMEZONE_ENTRY *timezone, void *data)

Timezone Enumeration Callback

Function Documentation

◆ timezone_add()

uint32_t STDCALL timezone_add ( TIMEZONE_DATA * data,
BOOL _default )

Add a Timezone from a timezone data block and to the Timezone table.

Timezone Functions

◆ timezone_delete()

uint32_t STDCALL timezone_delete ( TIMEZONE_ENTRY * timezone)

◆ timezone_get_name()

uint32_t STDCALL timezone_get_name ( TIMEZONE_ENTRY * timezone,
char * name,
uint32_t len )

◆ timezone_get_description()

uint32_t STDCALL timezone_get_description ( TIMEZONE_ENTRY * timezone,
char * description,
uint32_t len )

◆ timezone_get_bias()

int32_t STDCALL timezone_get_bias ( TIMEZONE_ENTRY * timezone)

◆ timezone_get_state()

uint32_t STDCALL timezone_get_state ( TIMEZONE_ENTRY * timezone)

Get the state of the supplied Timezone at the current date and time.

Parameters
TimezoneThe timezone entry to get the state for
Returns
The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone

◆ timezone_get_state_ex()

uint32_t STDCALL timezone_get_state_ex ( TIMEZONE_ENTRY * timezone,
double_t datetime )

Get the state of the supplied Timezone at the specified date and time.

Parameters
TimezoneThe timezone entry to get the state for
DateTimeThe date and time to get the state of the timezone at (Assumed to be Local)
Returns
The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone

◆ timezone_get_active_bias()

int32_t STDCALL timezone_get_active_bias ( TIMEZONE_ENTRY * timezone)

Get the bias (offset between UTC and Local) of the supplied Timezone at the current date and time.

Parameters
TimezoneThe timezone entry to get the bias for
Returns
The bias in minutes offset between UTC and Local including any daylight bias if active

◆ timezone_get_active_bias_ex()

int32_t STDCALL timezone_get_active_bias_ex ( TIMEZONE_ENTRY * timezone,
double_t datetime )

Get the bias (offset between UTC and Local) of the supplied Timezone at the specified date and time.

Parameters
TimezoneThe timezone entry to get the bias for
DateTimeThe date and time to get the bias of the timezone at (Assumed to be Local)
Returns
The bias in minutes offset between UTC and Local

◆ timezone_get_standard_name()

uint32_t STDCALL timezone_get_standard_name ( TIMEZONE_ENTRY * timezone,
char * name,
uint32_t len )

◆ timezone_get_standard_bias()

int32_t STDCALL timezone_get_standard_bias ( TIMEZONE_ENTRY * timezone)

◆ timezone_get_standard_date()

double_t STDCALL timezone_get_standard_date ( TIMEZONE_ENTRY * timezone,
BOOL next )

◆ timezone_get_standard_start()

SYSTEMTIME STDCALL timezone_get_standard_start ( TIMEZONE_ENTRY * timezone)

◆ timezone_get_daylight_name()

uint32_t STDCALL timezone_get_daylight_name ( TIMEZONE_ENTRY * timezone,
char * name,
uint32_t len )

◆ timezone_get_daylight_bias()

int32_t STDCALL timezone_get_daylight_bias ( TIMEZONE_ENTRY * timezone)

◆ timezone_get_daylight_date()

double_t STDCALL timezone_get_daylight_date ( TIMEZONE_ENTRY * timezone,
BOOL next )

◆ timezone_get_daylight_start()

SYSTEMTIME STDCALL timezone_get_daylight_start ( TIMEZONE_ENTRY * timezone)

◆ timezone_find()

TIMEZONE_ENTRY *STDCALL timezone_find ( const char * name)

◆ timezone_find_by_standard()

TIMEZONE_ENTRY *STDCALL timezone_find_by_standard ( const char * standardname)

◆ timezone_find_by_daylight()

TIMEZONE_ENTRY *STDCALL timezone_find_by_daylight ( const char * daylightname)

◆ timezone_enumerate()

uint32_t STDCALL timezone_enumerate ( timezone_enumerate_cb callback,
void * data )

◆ timezone_get_count()

uint32_t STDCALL timezone_get_count ( void )

Get the current timezone count.

Timezone Helper Functions

◆ timezone_get_default()

TIMEZONE_ENTRY *STDCALL timezone_get_default ( void )

Get the current default timezone.

◆ timezone_set_default()

uint32_t STDCALL timezone_set_default ( TIMEZONE_ENTRY * timezone)

Set the current default timezone.

◆ timezone_check()

TIMEZONE_ENTRY *STDCALL timezone_check ( TIMEZONE_ENTRY * timezone)

Check if the supplied Timezone is in the Timezone table.

◆ timezone_update_offset()

uint32_t STDCALL timezone_update_offset ( void )

◆ timezone_update_environment()

uint32_t STDCALL timezone_update_environment ( void )

Update the TZ environment variable to represent the current timezone.

See also
https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

◆ timezone_calculate_offset()

uint32_t STDCALL timezone_calculate_offset ( double_t datetime,
int32_t * offset,
BOOL * daylight )

Calculate the Timezone Offset at the given date and time in the current timezone.

Parameters
DateTimeThe date and time to calculate the offset for (Assumed to be Local)
OffsetThe returned Offset in minutes
DaylightTrue on return if daylight savings is in effect at the specified date and time
Returns
ERROR_SUCCESS if the offset was calculated or another error code on failure

◆ timezone_start_to_date_time()

double_t STDCALL timezone_start_to_date_time ( SYSTEMTIME * start,
uint16_t year )

Calculate the start date and time from the start date of a timezone.

◆ timezone_start_to_description()

uint32_t STDCALL timezone_start_to_description ( SYSTEMTIME * start,
char * description,
uint32_t len )

Get the description of the start date of a timezone.