MySQL 9.1.0
Source Code Documentation
|
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t conversion. More...
#include <tztime.h>
Public Types | |
enum | tz_type { TZ_DB = 1 , TZ_OFFSET = 2 , TZ_SYSTEM = 3 , TZ_UTC = 4 } |
Enum to identify the type of the timezone. More... | |
Public Member Functions | |
virtual my_time_t | TIME_to_gmt_sec (const MYSQL_TIME *t, bool *in_dst_time_gap) const =0 |
Converts local time in MYSQL_TIME representation to my_time_t (UTC seconds since Epoch) representation. More... | |
virtual void | gmt_sec_to_TIME (MYSQL_TIME *tmp, my_time_t t) const =0 |
Converts UTC epoch seconds to time in MYSQL_TIME representation. More... | |
void | gmt_sec_to_TIME (MYSQL_TIME *tmp, my_timeval tv) const |
Converts UTC epoch seconds and microseconds to time in MYSQL_TIME representation. More... | |
virtual const String * | get_name () const =0 |
Because of constness of String returned by get_name() time zone name have to be already zeroended to be able to use String::ptr() instead of c_ptr(). More... | |
virtual tz_type | get_timezone_type () const =0 |
Returns the timezone type set. More... | |
virtual long | get_timezone_offset () const =0 |
Returns the offset set for a Timezone offset. More... | |
virtual | ~Time_zone ()=default |
We need this only for suppressing warnings, objects of this type are allocated on MEM_ROOT and should not require destruction. More... | |
Static Protected Member Functions | |
static void | adjust_leap_second (MYSQL_TIME *t) |
Convert leap seconds into non-leap. More... | |
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t conversion.
Actual time zones which are specified by DB, or via offset or use system functions are its descendants.
enum Time_zone::tz_type |
|
virtualdefault |
We need this only for suppressing warnings, objects of this type are allocated on MEM_ROOT and should not require destruction.
|
inlinestaticprotected |
Convert leap seconds into non-leap.
This function will convert the leap seconds added by the OS to non-leap seconds, e.g. 23:59:59, 23:59:60 -> 23:59:59, 00:00:01 ... This check is not checking for years on purpose : although it's not a complete check this way it doesn't require looking (and having installed) the leap seconds table.
[in,out] | t | broken down time structure as filled in by the OS |
|
pure virtual |
Because of constness of String returned by get_name() time zone name have to be already zeroended to be able to use String::ptr() instead of c_ptr().
Implemented in Time_zone_system, Time_zone_utc, Time_zone_db, and Time_zone_offset.
|
pure virtual |
Returns the offset set for a Timezone offset.
This function has to be invoked ONLY when TZ_OFFSET is set.
Implemented in Time_zone_system, Time_zone_utc, Time_zone_db, and Time_zone_offset.
|
pure virtual |
Returns the timezone type set.
Implemented in Time_zone_system, Time_zone_utc, Time_zone_db, and Time_zone_offset.
|
pure virtual |
Converts UTC epoch seconds to time in MYSQL_TIME representation.
[out] | tmp | equivalent time point in MYSQL_TIME representation |
[in] | t | number of seconds in UNIX epoch |
Implemented in Time_zone_system, Time_zone_utc, Time_zone_db, and Time_zone_offset.
|
inline |
Converts UTC epoch seconds and microseconds to time in MYSQL_TIME representation.
[in] | tv | number of seconds and microseconds in UNIX epoch |
[out] | tmp | equivalent time point in MYSQL_TIME representation |
|
pure virtual |
Converts local time in MYSQL_TIME representation to my_time_t (UTC seconds since Epoch) representation.
Returns 0 in case of error. Sets in_dst_time_gap to true if date provided falls into spring time-gap (or lefts it untouched otherwise).
Implemented in Time_zone_system, Time_zone_utc, Time_zone_db, and Time_zone_offset.