Skip to content

File tz_support.c

FileList > base > tz_support.c

Go to the source code of this file

  • #include "config.h"
  • #include <assert.h>
  • #include "tz_support.h"
  • #include "db_date.h"
  • #include "environment_variable.h"
  • #include "chartype.h"
  • #include "error_manager.h"
  • #include <dlfcn.h>
  • #include <unistd.h>
  • #include "system_parameter.h"
  • #include "show_scan.h"
  • #include "session.h"
  • #include "boot_sr.h"
  • #include "dbtype.h"
  • #include "thread_manager.hpp"
  • #include "memory_wrapper.hpp"

Classes

Type Name
struct tz_decode_info

Public Types

Type Name
typedef enum ds_search_direction DS_SEARCH_DIRECTION
typedef struct tz_decode_info TZ_DECODE_INFO
enum ds_search_direction

Public Attributes

Type Name
bool tz_Compare_datetimetz_tz_id = [**false**](broker__monitor_8c.md#function-timeout)
bool tz_Compare_timestamptz_tz_id = [**false**](broker__monitor_8c.md#function-timeout)
bool tz_Is_backward_compatible_timezone

Public Static Attributes

Type Name
const int tz_Days_of_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
const int tz_Days_up_to_month = { 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
int tz_Initialized = 0
void * tz_Lib_handle = [**NULL**](freelistheap_8h.md#define-null)
TZ_DATA tz_New_timezone_data = { 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), {'0'} }
TZ_REGION tz_Region_system
TZ_DATA tz_Timezone_data = { 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), 0, [**NULL**](freelistheap_8h.md#define-null), {'0'} }

Public Functions

Type Name
int check_timezone_compat (const char * client_checksum, const char * server_checksum, const char * client_text, const char * server_text)
int conv_tz (void * p_out, const void * p_in, DB_TYPE type)
int tz_check_geographic_tz (const TZ_ID * tz_id)
int tz_check_session_has_geographic_tz (void)
int tz_conv_tz_datetime_w_region (const DB_DATETIME * src_dt, const TZ_REGION * src_tz_region, const TZ_REGION * dest_tz_region, DB_DATETIME * dest_dt, TZ_ID * src_tz_id_out, TZ_ID * dest_tz_id_out)
int tz_conv_tz_datetime_w_zone_name (const DB_DATETIME * src_dt, const char * source_zone, int len_source, const char * dest_zone, int len_dest, DB_DATETIME * dest_dt)
int tz_conv_tz_time_w_zone_name (const DB_TIME * time_source, const char * source_zone, int len_source, const char * dest_zone, int len_dest, DB_TIME * time_dest)
int tz_create_datetimetz (const DB_DATETIME * dt, const char * tz_str, const int tz_size, const TZ_REGION * default_tz_region, DB_DATETIMETZ * dt_tz, const char ** end_tz_str)
int tz_create_datetimetz_from_offset (const DB_DATETIME * dt, const int tzh, const int tzm, DB_DATETIMETZ * dt_tz)
int tz_create_datetimetz_from_parts (const int m, const int d, const int y, const int h, const int mi, const int s, const int ms, const TZ_ID * tz_id, DB_DATETIMETZ * dt_tz)
int tz_create_datetimetz_from_ses (const DB_DATETIME * dt, DB_DATETIMETZ * dt_tz)
int tz_create_datetimetz_from_utc (const DB_DATETIME * src_dt, const TZ_REGION * dest_region, DB_DATETIMETZ * dest_dt_tz)
int tz_create_datetimetz_from_zoneid_and_tzd (const DB_DATETIME * dt, TZ_REGION * default_tz_region, const int zone_id, const char * tzd, const int tzd_len, bool is_time_tz, DB_DATETIMETZ * dt_tz)
int tz_create_session_tzid_for_datetime (const DB_DATETIME * src_dt, bool src_is_utc, TZ_ID * tz_id)
int tz_create_session_tzid_for_time (const DB_TIME * src_time, bool src_is_utc, TZ_ID * tz_id)
int tz_create_session_tzid_for_timestamp (const DB_UTIME * src_ts, TZ_ID * tz_id)
int tz_create_timestamptz (const DB_DATE * date, const DB_TIME * time, const char * tz_str, const int tz_size, const TZ_REGION * default_tz_region, DB_TIMESTAMPTZ * ts_tz, const char ** end_tz_str)
int tz_create_timestamptz_from_offset (const DB_DATE * date, const DB_TIME * time, const int tzh, const int tzm, DB_TIMESTAMPTZ * timestamp_tz)
int tz_create_timestamptz_from_zoneid_and_tzd (const DB_DATE * date, const DB_TIME * time, TZ_REGION * default_tz_region, const int zone_id, const char * tzd, const int tzd_len, DB_TIMESTAMPTZ * timestamp_tz)
int tz_datetimeltz_to_local (const DB_DATETIME * dt_ltz, DB_DATETIME * dt_local)
int tz_datetimetz_fix_zone (const DB_DATETIMETZ * src_dt_tz, DB_DATETIMETZ * dest_dt_tz)
int tz_explain_tz_id (const TZ_ID * tz_id, char * tzr, const int tzr_size, char * tzdst, const int tzdst_size, int * tzh, int * tzm)
int tz_get_best_match_zone (const char * name, int * size)
const TZ_DATA * tz_get_data (void)
int tz_get_ds_change_julian_date_diff (const int src_julian_date, const TZ_DS_RULE * ds_rule, const int year, int * ds_rule_julian_date, full_date_t * date_diff)
int tz_get_first_weekday_around_date (const int year, const int month, const int weekday, const int ref_day, const bool before)
const TZ_DATA * tz_get_new_timezone_data (void)
int tz_get_offset_in_mins ()
TZ_REGION * tz_get_server_tz_region_session (void)
const char * tz_get_session_local_timezone (void)
void tz_get_session_tz_region (TZ_REGION * tz_region)
const char * tz_get_system_timezone (void)
void tz_get_system_tz_region (TZ_REGION * tz_region)
int tz_get_timezone_offset (const char * tz_str, int tz_size, char * result, DB_DATETIME * utc_datetime)
const TZ_ID * tz_get_utc_tz_id (void)
const TZ_REGION * tz_get_utc_tz_region (void)
void tz_id_to_region (const TZ_ID * tz_id, TZ_REGION * tz_region)
int tz_id_to_str (const TZ_ID * tz_id, char * tz_str, const int tz_str_size)
int tz_load (void)
int tz_load_with_library_path (TZ_DATA * tzd, const char * timezone_library_path)
int tz_resolve_os_timezone (char * timezone, int buf_len)
void tz_set_data (const TZ_DATA * data)
void tz_set_new_timezone_data (const TZ_DATA * data)
void tz_set_tz_region_system (const TZ_REGION * tz_region)
int tz_str_read_number (const char * str, const char * str_end, const bool strict, const bool read_sign, int * val, const char ** str_next)
int tz_str_read_time (const char * str, const char * str_end, bool need_minutes, bool allow_sec60, int * hour, int * min, int * sec, const char ** str_next)
int tz_str_to_region (const char * tz_str, const int tz_str_size, TZ_REGION * tz_region)
int tz_str_to_seconds (const char * str, const char * str_end, int * seconds, const char ** str_next, const bool is_offset)
void tz_timestamp_decode_no_leap_sec (int timestamp, int * yearp, int * monthsp, int * dayp, int * hoursp, int * minutesp, int * secondsp)
void tz_timestamp_decode_sec (int timestamp, int * yearp, int * monthsp, int * dayp, int * hoursp, int * minutesp, int * secondsp)
DB_BIGINT tz_timestamp_encode_leap_sec_adj (const int year_century, const int year, const int mon, const int day)
int tz_timestamptz_fix_zone (const DB_TIMESTAMPTZ * src_ts_tz, DB_TIMESTAMPTZ * dest_ts_tz)
void tz_tzid_convert_region_to_offset (TZ_ID * tz_id)
void tz_unload (void)
int tz_utc_datetimetz_to_local (const DB_DATETIME * dt_utc, const TZ_ID * tz_id, DB_DATETIME * dt_local)

Public Static Functions

Type Name
int get_closest_ds_rule (const int src_julian_date, const int src_time_sec, const TZ_DS_RULESET * ds_ruleset, const TZ_DATA * tzd, const DS_SEARCH_DIRECTION direction)
int get_date_diff_from_ds_rule (const int src_julian_date, const int src_time_sec, const TZ_DS_RULE * ds_rule, const DS_SEARCH_DIRECTION direction, full_date_t * date_diff)
int get_saving_time_from_offset_rule (const TZ_OFFSET_RULE * offset_rule, const TZ_DATA * tzd, int * save_time)
int get_year_to_apply_rule (const int src_year, const TZ_DS_RULE * ds_rule)
bool is_in_overlap_interval (const TZ_TIME_TYPE time_type, const full_date_t offset_rule_diff, const full_date_t gmt_diff, const int save_time_diff)
int set_new_zone_id (TZ_DECODE_INFO * tz_info)
int starts_with (const char * prefix, const char * str)
bool tz_check_ds_match_string (const TZ_OFFSET_RULE * off_rule, const TZ_DS_RULE * ds_rule, const char * ds_string, const char * default_abrev)
int tz_conv_tz_datetime_w_zone_info (const DB_DATETIME * src_dt, const TZ_DECODE_INFO * src_zone_info_in, const TZ_DECODE_INFO * dest_zone_info_in, DB_DATETIME * dest_dt, TZ_DECODE_INFO * src_zone_info_out, TZ_DECODE_INFO * dest_zone_info_out)
int tz_datetime_utc_conv (const DB_DATETIME * src_dt, TZ_DECODE_INFO * tz_info, bool src_is_utc, bool only_tz_adjust, DB_DATETIME * dest_dt)
void tz_decode_tz_id (const TZ_ID * tz_id, const bool is_full_decode, TZ_DECODE_INFO * tz_info)
void tz_decode_tz_region (const TZ_REGION * tz_region, TZ_DECODE_INFO * tz_info)
void tz_encode_tz_id (const TZ_DECODE_INFO * tz_info, TZ_ID * tz_id)
void tz_encode_tz_region (const TZ_DECODE_INFO * tz_info, TZ_REGION * tz_region)
int tz_fast_find_ds_rule (const TZ_DATA * tzd, const TZ_DS_RULESET * ds_ruleset, const int src_julian_date, const int src_year, const int src_month, int * ds_rule_id)
DB_DATE tz_get_current_date (void)
const TZ_REGION * tz_get_invalid_tz_region (void)
bool tz_get_leapsec_support (void)
int tz_get_zone_id_by_name (const char * name, const int name_size)
int tz_load_data_from_lib (TZ_DATA * tzd, void * lib_handle)
int tz_load_library (const char * lib_file, void ** handle)
int tz_offset (const bool src_is_utc, const TZ_TIME_TYPE until_time_type, const int gmt_offset_sec, const int ds_save_time)
int tz_print_tz_offset (char * result, int tz_offset)
int tz_str_timezone_decode (const char * tz_str, const int tz_str_size, TZ_DECODE_INFO * tz_info, const char ** tz_end)
void tz_timestamp_decode_leap_sec_adj (int timestamp, int * yearp, int * monthsp, int * dayp, int * hoursp, int * minutesp, int * secondsp)
int tz_zone_info_to_str (const TZ_DECODE_INFO * tz_info, char * tz_str, const int tz_str_size)

Macros

Type Name
define ABS (i) (([**i**](dynamic__load_8c.md#variable-i)) &gt;= 0 ? ([**i**](dynamic__load_8c.md#variable-i)) : -([**i**](dynamic__load_8c.md#variable-i)))
define APPLY_NEXT_OFF_RULE () /* multi line expression */
define FULL_DATE (jul_date, time_sec) /* multi line expression */
define LEN_MIN_HOUR 6
define LEN_MIN_HOUR_SEC 9
define MILLIS_IN_A_DAY ([**long**](broker__monitor_8c.md#function-timeout))(86400000) /\* 24[**L**](broker__monitor_8c.md#function-timeout) \* 60L \* 60L \* 1000 \*/
define SECONDS_IN_A_DAY 24 \* 3600
define TIME_OFFSET (is_utc, offset) (([**is\_utc**](broker__monitor_8c.md#function-timeout)) ? (-offset) : (offset))
define TZLIB_GET_ADDR (v, SYM_NAME, SYM_TYPE, lh) /* multi line expression */
define TZLIB_GET_VAL (v, SYM_NAME, SYM_TYPE, lh) /* multi line expression */
define TZ_BIT_SHIFT_TZ_ID_FLAG 30
define TZ_GET_SYM_ADDR (lib, sym) [**dlsym**](broker__monitor_8c.md#function-timeout)([**lib**](broker__monitor_8c.md#function-timeout), [**sym**](broker__monitor_8c.md#function-timeout))
define TZ_INVALID_OFFSET ((((23 \* 60) + 59) \* 60) + 59)
define TZ_MASK_TZ_ID_FLAG 0xc0000000
define TZ_MAX_OFFSET 14 \* 3600
define TZ_MIN_OFFSET -12 \* 3600
define TZ_OFFSET_MASK 0x3fffffff
define strlen (s1) (([**int**](broker__monitor_8c.md#function-timeout)) strlen([**s1**](broker__monitor_8c.md#function-timeout)))

Public Types Documentation

typedef DS_SEARCH_DIRECTION

typedef enum ds_search_direction DS_SEARCH_DIRECTION;

typedef TZ_DECODE_INFO

typedef struct tz_decode_info TZ_DECODE_INFO;

enum ds_search_direction

enum ds_search_direction {
    FORWARD = 0,
    BACKWARD = 1
};

Public Attributes Documentation

variable tz_Compare_datetimetz_tz_id

bool tz_Compare_datetimetz_tz_id;

variable tz_Compare_timestamptz_tz_id

bool tz_Compare_timestamptz_tz_id;

variable tz_Is_backward_compatible_timezone

bool tz_Is_backward_compatible_timezone[10000];

Public Static Attributes Documentation

variable tz_Days_of_month

const int tz_Days_of_month[];

variable tz_Days_up_to_month

const int tz_Days_up_to_month[];

variable tz_Initialized

int tz_Initialized;

variable tz_Lib_handle

void* tz_Lib_handle;

variable tz_New_timezone_data

TZ_DATA tz_New_timezone_data;

variable tz_Region_system

TZ_REGION tz_Region_system;

variable tz_Timezone_data

TZ_DATA tz_Timezone_data;

Public Functions Documentation

function check_timezone_compat

int check_timezone_compat (
    const  char * client_checksum,
    const  char * server_checksum,
    const  char * client_text,
    const  char * server_text
) 

function conv_tz

int conv_tz (
    void * p_out,
    const  void * p_in,
    DB_TYPE type
) 

function tz_check_geographic_tz

int tz_check_geographic_tz (
    const  TZ_ID * tz_id
) 

function tz_check_session_has_geographic_tz

int tz_check_session_has_geographic_tz (
    void
) 

function tz_conv_tz_datetime_w_region

int tz_conv_tz_datetime_w_region (
    const  DB_DATETIME * src_dt,
    const  TZ_REGION * src_tz_region,
    const  TZ_REGION * dest_tz_region,
    DB_DATETIME * dest_dt,
    TZ_ID * src_tz_id_out,
    TZ_ID * dest_tz_id_out
) 

function tz_conv_tz_datetime_w_zone_name

int tz_conv_tz_datetime_w_zone_name (
    const  DB_DATETIME * src_dt,
    const  char * source_zone,
    int len_source,
    const  char * dest_zone,
    int len_dest,
    DB_DATETIME * dest_dt
) 

function tz_conv_tz_time_w_zone_name

int tz_conv_tz_time_w_zone_name (
    const  DB_TIME * time_source,
    const  char * source_zone,
    int len_source,
    const  char * dest_zone,
    int len_dest,
    DB_TIME * time_dest
) 

function tz_create_datetimetz

int tz_create_datetimetz (
    const  DB_DATETIME * dt,
    const  char * tz_str,
    const  int tz_size,
    const  TZ_REGION * default_tz_region,
    DB_DATETIMETZ * dt_tz,
    const  char ** end_tz_str
) 

function tz_create_datetimetz_from_offset

int tz_create_datetimetz_from_offset (
    const  DB_DATETIME * dt,
    const  int tzh,
    const  int tzm,
    DB_DATETIMETZ * dt_tz
) 

function tz_create_datetimetz_from_parts

int tz_create_datetimetz_from_parts (
    const  int m,
    const  int d,
    const  int y,
    const  int h,
    const  int mi,
    const  int s,
    const  int ms,
    const  TZ_ID * tz_id,
    DB_DATETIMETZ * dt_tz
) 

function tz_create_datetimetz_from_ses

int tz_create_datetimetz_from_ses (
    const  DB_DATETIME * dt,
    DB_DATETIMETZ * dt_tz
) 

function tz_create_datetimetz_from_utc

int tz_create_datetimetz_from_utc (
    const  DB_DATETIME * src_dt,
    const  TZ_REGION * dest_region,
    DB_DATETIMETZ * dest_dt_tz
) 

function tz_create_datetimetz_from_zoneid_and_tzd

int tz_create_datetimetz_from_zoneid_and_tzd (
    const  DB_DATETIME * dt,
    TZ_REGION * default_tz_region,
    const  int zone_id,
    const  char * tzd,
    const  int tzd_len,
    bool is_time_tz,
    DB_DATETIMETZ * dt_tz
) 

function tz_create_session_tzid_for_datetime

int tz_create_session_tzid_for_datetime (
    const  DB_DATETIME * src_dt,
    bool src_is_utc,
    TZ_ID * tz_id
) 

function tz_create_session_tzid_for_time

int tz_create_session_tzid_for_time (
    const  DB_TIME * src_time,
    bool src_is_utc,
    TZ_ID * tz_id
) 

function tz_create_session_tzid_for_timestamp

int tz_create_session_tzid_for_timestamp (
    const  DB_UTIME * src_ts,
    TZ_ID * tz_id
) 

function tz_create_timestamptz

int tz_create_timestamptz (
    const  DB_DATE * date,
    const  DB_TIME * time,
    const  char * tz_str,
    const  int tz_size,
    const  TZ_REGION * default_tz_region,
    DB_TIMESTAMPTZ * ts_tz,
    const  char ** end_tz_str
) 

function tz_create_timestamptz_from_offset

int tz_create_timestamptz_from_offset (
    const  DB_DATE * date,
    const  DB_TIME * time,
    const  int tzh,
    const  int tzm,
    DB_TIMESTAMPTZ * timestamp_tz
) 

function tz_create_timestamptz_from_zoneid_and_tzd

int tz_create_timestamptz_from_zoneid_and_tzd (
    const  DB_DATE * date,
    const  DB_TIME * time,
    TZ_REGION * default_tz_region,
    const  int zone_id,
    const  char * tzd,
    const  int tzd_len,
    DB_TIMESTAMPTZ * timestamp_tz
) 

function tz_datetimeltz_to_local

int tz_datetimeltz_to_local (
    const  DB_DATETIME * dt_ltz,
    DB_DATETIME * dt_local
) 

function tz_datetimetz_fix_zone

int tz_datetimetz_fix_zone (
    const  DB_DATETIMETZ * src_dt_tz,
    DB_DATETIMETZ * dest_dt_tz
) 

function tz_explain_tz_id

int tz_explain_tz_id (
    const  TZ_ID * tz_id,
    char * tzr,
    const  int tzr_size,
    char * tzdst,
    const  int tzdst_size,
    int * tzh,
    int * tzm
) 

function tz_get_best_match_zone

int tz_get_best_match_zone (
    const  char * name,
    int * size
) 

function tz_get_data

const  TZ_DATA * tz_get_data (
    void
) 

function tz_get_ds_change_julian_date_diff

int tz_get_ds_change_julian_date_diff (
    const  int src_julian_date,
    const  TZ_DS_RULE * ds_rule,
    const  int year,
    int * ds_rule_julian_date,
    full_date_t * date_diff
) 

function tz_get_first_weekday_around_date

int tz_get_first_weekday_around_date (
    const  int year,
    const  int month,
    const  int weekday,
    const  int ref_day,
    const  bool before
) 

function tz_get_new_timezone_data

const  TZ_DATA * tz_get_new_timezone_data (
    void
) 

function tz_get_offset_in_mins

int tz_get_offset_in_mins () 

function tz_get_server_tz_region_session

TZ_REGION * tz_get_server_tz_region_session (
    void
) 

function tz_get_session_local_timezone

const  char * tz_get_session_local_timezone (
    void
) 

function tz_get_session_tz_region

void tz_get_session_tz_region (
    TZ_REGION * tz_region
) 

function tz_get_system_timezone

const  char * tz_get_system_timezone (
    void
) 

function tz_get_system_tz_region

void tz_get_system_tz_region (
    TZ_REGION * tz_region
) 

function tz_get_timezone_offset

int tz_get_timezone_offset (
    const  char * tz_str,
    int tz_size,
    char * result,
    DB_DATETIME * utc_datetime
) 

function tz_get_utc_tz_id

const  TZ_ID * tz_get_utc_tz_id (
    void
) 

function tz_get_utc_tz_region

const  TZ_REGION * tz_get_utc_tz_region (
    void
) 

function tz_id_to_region

void tz_id_to_region (
    const  TZ_ID * tz_id,
    TZ_REGION * tz_region
) 

function tz_id_to_str

int tz_id_to_str (
    const  TZ_ID * tz_id,
    char * tz_str,
    const  int tz_str_size
) 

function tz_load

int tz_load (
    void
) 

function tz_load_with_library_path

int tz_load_with_library_path (
    TZ_DATA * tzd,
    const  char * timezone_library_path
) 

function tz_resolve_os_timezone

int tz_resolve_os_timezone (
    char * timezone,
    int buf_len
) 

function tz_set_data

void tz_set_data (
    const  TZ_DATA * data
) 

function tz_set_new_timezone_data

void tz_set_new_timezone_data (
    const  TZ_DATA * data
) 

function tz_set_tz_region_system

void tz_set_tz_region_system (
    const  TZ_REGION * tz_region
) 

function tz_str_read_number

int tz_str_read_number (
    const  char * str,
    const  char * str_end,
    const  bool strict,
    const  bool read_sign,
    int * val,
    const  char ** str_next
) 

function tz_str_read_time

int tz_str_read_time (
    const  char * str,
    const  char * str_end,
    bool need_minutes,
    bool allow_sec60,
    int * hour,
    int * min,
    int * sec,
    const  char ** str_next
) 

function tz_str_to_region

int tz_str_to_region (
    const  char * tz_str,
    const  int tz_str_size,
    TZ_REGION * tz_region
) 

function tz_str_to_seconds

int tz_str_to_seconds (
    const  char * str,
    const  char * str_end,
    int * seconds,
    const  char ** str_next,
    const  bool is_offset
) 

function tz_timestamp_decode_no_leap_sec

void tz_timestamp_decode_no_leap_sec (
    int timestamp,
    int * yearp,
    int * monthsp,
    int * dayp,
    int * hoursp,
    int * minutesp,
    int * secondsp
) 

function tz_timestamp_decode_sec

void tz_timestamp_decode_sec (
    int timestamp,
    int * yearp,
    int * monthsp,
    int * dayp,
    int * hoursp,
    int * minutesp,
    int * secondsp
) 

function tz_timestamp_encode_leap_sec_adj

DB_BIGINT tz_timestamp_encode_leap_sec_adj (
    const  int year_century,
    const  int year,
    const  int mon,
    const  int day
) 

function tz_timestamptz_fix_zone

int tz_timestamptz_fix_zone (
    const  DB_TIMESTAMPTZ * src_ts_tz,
    DB_TIMESTAMPTZ * dest_ts_tz
) 

function tz_tzid_convert_region_to_offset

void tz_tzid_convert_region_to_offset (
    TZ_ID * tz_id
) 

function tz_unload

void tz_unload (
    void
) 

function tz_utc_datetimetz_to_local

int tz_utc_datetimetz_to_local (
    const  DB_DATETIME * dt_utc,
    const  TZ_ID * tz_id,
    DB_DATETIME * dt_local
) 

Public Static Functions Documentation

function get_closest_ds_rule

static int get_closest_ds_rule (
    const  int src_julian_date,
    const  int src_time_sec,
    const  TZ_DS_RULESET * ds_ruleset,
    const  TZ_DATA * tzd,
    const  DS_SEARCH_DIRECTION direction
) 

function get_date_diff_from_ds_rule

static int get_date_diff_from_ds_rule (
    const  int src_julian_date,
    const  int src_time_sec,
    const  TZ_DS_RULE * ds_rule,
    const  DS_SEARCH_DIRECTION direction,
    full_date_t * date_diff
) 

function get_saving_time_from_offset_rule

static int get_saving_time_from_offset_rule (
    const  TZ_OFFSET_RULE * offset_rule,
    const  TZ_DATA * tzd,
    int * save_time
) 

function get_year_to_apply_rule

static int get_year_to_apply_rule (
    const  int src_year,
    const  TZ_DS_RULE * ds_rule
) 

function is_in_overlap_interval

static bool is_in_overlap_interval (
    const  TZ_TIME_TYPE time_type,
    const  full_date_t offset_rule_diff,
    const  full_date_t gmt_diff,
    const  int save_time_diff
) 

function set_new_zone_id

static int set_new_zone_id (
    TZ_DECODE_INFO * tz_info
) 

function starts_with

static int starts_with (
    const  char * prefix,
    const  char * str
) 

function tz_check_ds_match_string

static bool tz_check_ds_match_string (
    const  TZ_OFFSET_RULE * off_rule,
    const  TZ_DS_RULE * ds_rule,
    const  char * ds_string,
    const  char * default_abrev
) 

function tz_conv_tz_datetime_w_zone_info

static int tz_conv_tz_datetime_w_zone_info (
    const  DB_DATETIME * src_dt,
    const  TZ_DECODE_INFO * src_zone_info_in,
    const  TZ_DECODE_INFO * dest_zone_info_in,
    DB_DATETIME * dest_dt,
    TZ_DECODE_INFO * src_zone_info_out,
    TZ_DECODE_INFO * dest_zone_info_out
) 

function tz_datetime_utc_conv

static int tz_datetime_utc_conv (
    const  DB_DATETIME * src_dt,
    TZ_DECODE_INFO * tz_info,
    bool src_is_utc,
    bool only_tz_adjust,
    DB_DATETIME * dest_dt
) 

function tz_decode_tz_id

static void tz_decode_tz_id (
    const  TZ_ID * tz_id,
    const  bool is_full_decode,
    TZ_DECODE_INFO * tz_info
) 

function tz_decode_tz_region

static void tz_decode_tz_region (
    const  TZ_REGION * tz_region,
    TZ_DECODE_INFO * tz_info
) 

function tz_encode_tz_id

static void tz_encode_tz_id (
    const  TZ_DECODE_INFO * tz_info,
    TZ_ID * tz_id
) 

function tz_encode_tz_region

static void tz_encode_tz_region (
    const  TZ_DECODE_INFO * tz_info,
    TZ_REGION * tz_region
) 

function tz_fast_find_ds_rule

static int tz_fast_find_ds_rule (
    const  TZ_DATA * tzd,
    const  TZ_DS_RULESET * ds_ruleset,
    const  int src_julian_date,
    const  int src_year,
    const  int src_month,
    int * ds_rule_id
) 

function tz_get_current_date

static DB_DATE tz_get_current_date (
    void
) 

function tz_get_invalid_tz_region

static const  TZ_REGION * tz_get_invalid_tz_region (
    void
) 

function tz_get_leapsec_support

static bool tz_get_leapsec_support (
    void
) 

function tz_get_zone_id_by_name

static int tz_get_zone_id_by_name (
    const  char * name,
    const  int name_size
) 

function tz_load_data_from_lib

static int tz_load_data_from_lib (
    TZ_DATA * tzd,
    void * lib_handle
) 

function tz_load_library

static int tz_load_library (
    const  char * lib_file,
    void ** handle
) 

function tz_offset

static int tz_offset (
    const  bool src_is_utc,
    const  TZ_TIME_TYPE until_time_type,
    const  int gmt_offset_sec,
    const  int ds_save_time
) 

function tz_print_tz_offset

static int tz_print_tz_offset (
    char * result,
    int tz_offset
) 

function tz_str_timezone_decode

static int tz_str_timezone_decode (
    const  char * tz_str,
    const  int tz_str_size,
    TZ_DECODE_INFO * tz_info,
    const  char ** tz_end
) 

function tz_timestamp_decode_leap_sec_adj

static void tz_timestamp_decode_leap_sec_adj (
    int timestamp,
    int * yearp,
    int * monthsp,
    int * dayp,
    int * hoursp,
    int * minutesp,
    int * secondsp
) 

function tz_zone_info_to_str

static int tz_zone_info_to_str (
    const  TZ_DECODE_INFO * tz_info,
    char * tz_str,
    const  int tz_str_size
) 

Macro Definition Documentation

define ABS

#define ABS (
    i
) `(( i ) >= 0 ? ( i ) : -( i ))`

define APPLY_NEXT_OFF_RULE

#define APPLY_NEXT_OFF_RULE (

) `/* multi line expression */`

define FULL_DATE

#define FULL_DATE (
    jul_date,
    time_sec
) `/* multi line expression */`

define LEN_MIN_HOUR

#define LEN_MIN_HOUR `6`

define LEN_MIN_HOUR_SEC

#define LEN_MIN_HOUR_SEC `9`

define MILLIS_IN_A_DAY

#define MILLIS_IN_A_DAY `( long )(86400000) /* 24 L * 60L * 60L * 1000 */`

define SECONDS_IN_A_DAY

#define SECONDS_IN_A_DAY `24 * 3600`

define TIME_OFFSET

#define TIME_OFFSET (
    is_utc,
    offset
) `(( is_utc ) ? (-offset) : (offset))`

define TZLIB_GET_ADDR

#define TZLIB_GET_ADDR (
    v,
    SYM_NAME,
    SYM_TYPE,
    lh
) `/* multi line expression */`

define TZLIB_GET_VAL

#define TZLIB_GET_VAL (
    v,
    SYM_NAME,
    SYM_TYPE,
    lh
) `/* multi line expression */`

define TZ_BIT_SHIFT_TZ_ID_FLAG

#define TZ_BIT_SHIFT_TZ_ID_FLAG `30`

define TZ_GET_SYM_ADDR

#define TZ_GET_SYM_ADDR (
    lib,
    sym
) `dlsym ( lib , sym )`

define TZ_INVALID_OFFSET

#define TZ_INVALID_OFFSET `((((23 * 60) + 59) * 60) + 59)`

define TZ_MASK_TZ_ID_FLAG

#define TZ_MASK_TZ_ID_FLAG `0xc0000000`

define TZ_MAX_OFFSET

#define TZ_MAX_OFFSET `14 * 3600`

define TZ_MIN_OFFSET

#define TZ_MIN_OFFSET `-12 * 3600`

define TZ_OFFSET_MASK

#define TZ_OFFSET_MASK `0x3fffffff`

define strlen

#define strlen (
    s1
) `(( int ) strlen( s1 ))`


The documentation for this class was generated from the following file cubrid/src/base/tz_support.c