MySQL 9.1.0
Source Code Documentation
Time_zone_db Class Reference
Inheritance diagram for Time_zone_db:
[legend]

Public Member Functions

 Time_zone_db (TIME_ZONE_INFO *tz_info_arg, const String *tz_name_arg)
 
my_time_t TIME_to_gmt_sec (const MYSQL_TIME *t, bool *in_dst_time_gap) const override
 Converts the date/time value to my_time_t representation. More...
 
void gmt_sec_to_TIME (MYSQL_TIME *tmp, my_time_t t) const override
 Converts UTC epoch seconds to time in MYSQL_TIME representation. More...
 
const Stringget_name () const override
 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...
 
tz_type get_timezone_type () const override
 Returns the timezone type set. More...
 
long get_timezone_offset () const override
 Returns the offset set for a Timezone offset. More...
 
- Public Member Functions inherited from Time_zone
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 ~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...
 

Private Attributes

TIME_ZONE_INFOtz_info
 
const Stringtz_name
 

Additional Inherited Members

- Public Types inherited from Time_zone
enum  tz_type { TZ_DB = 1 , TZ_OFFSET = 2 , TZ_SYSTEM = 3 , TZ_UTC = 4 }
 Enum to identify the type of the timezone. More...
 
- Static Protected Member Functions inherited from Time_zone
static void adjust_leap_second (MYSQL_TIME *t)
 Convert leap seconds into non-leap. More...
 

Constructor & Destructor Documentation

◆ Time_zone_db()

Time_zone_db::Time_zone_db ( TIME_ZONE_INFO tz_info_arg,
const String tz_name_arg 
)

Member Function Documentation

◆ get_name()

const String * Time_zone_db::get_name ( ) const
overridevirtual

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().

Implements Time_zone.

◆ get_timezone_offset()

long Time_zone_db::get_timezone_offset ( ) const
inlineoverridevirtual

Returns the offset set for a Timezone offset.

This function has to be invoked ONLY when TZ_OFFSET is set.

Implements Time_zone.

◆ get_timezone_type()

tz_type Time_zone_db::get_timezone_type ( ) const
inlineoverridevirtual

Returns the timezone type set.

Implements Time_zone.

◆ gmt_sec_to_TIME()

void Time_zone_db::gmt_sec_to_TIME ( MYSQL_TIME tmp,
my_time_t  t 
) const
overridevirtual

Converts UTC epoch seconds to time in MYSQL_TIME representation.

Parameters
[out]tmpequivalent time point in MYSQL_TIME representation
[in]tnumber of seconds in UNIX epoch

Implements Time_zone.

◆ TIME_to_gmt_sec()

my_time_t Time_zone_db::TIME_to_gmt_sec ( const MYSQL_TIME mt,
bool *  in_dst_time_gap 
) const
overridevirtual

Converts the date/time value to my_time_t representation.

If the date/time value has a time zone displacement, it is taken to be in UTC and the displacement is subtracted. Otherwise, it gets interpreted as being in the time zone described by this object.

Parameters
mtPointer to MYSQL_TIME structure with local time in broken-down representation.
[out]in_dst_time_gapSet to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap,) not touched otherwise.
See also
TIME_to_gmt_sec() for function description and parameter restrictions.
Returns
Corresponding my_time_t value or 0 in case of error.

Implements Time_zone.

Member Data Documentation

◆ tz_info

TIME_ZONE_INFO* Time_zone_db::tz_info
private

◆ tz_name

const String* Time_zone_db::tz_name
private

The documentation for this class was generated from the following file: