Drizzled Public API Documentation

drizzled::Time_zone_system Class Reference

Inheritance diagram for drizzled::Time_zone_system:
drizzled::Time_zone drizzled::memory::SqlAlloc

List of all members.

Public Member Functions

virtual type::Time::epoch_t TIME_to_gmt_sec (const type::Time &t, bool *in_dst_time_gap) const
 Converts local time in system time zone in type::Time representation to its type::Time::epoch_t representation.
virtual void gmt_sec_to_TIME (type::Time &tmp, type::Time::epoch_t t) const
 Converts time from UTC seconds since Epoch (type::Time::epoch_t) representation to system local time zone broken-down representation.
virtual const Stringget_name () const
 Get name of time zone.

Static Public Member Functions

static void * operator new (size_t size)
static void * operator new (size_t size, Root *mem_root)
static void * operator new[] (size_t size)
static void * operator new[] (size_t size, Root *mem_root)
static void operator delete (void *, size_t)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)
static void operator delete[] (void *, size_t)

Detailed Description

Instance of this class represents local time zone used on this system (specified by TZ environment variable or via any other system mechanism). It uses system functions (localtime_r, my_system_gmt_sec) for conversion and is always available. Because of this it is used by default - if there were no explicit time zone specified. On the other hand because of this conversion methods provided by this class is significantly slower and possibly less multi-threaded-friendly than corresponding Time_zone_db methods so the latter should be preffered there it is possible.

Definition at line 47 of file tztime.cc.


Member Function Documentation

const String * drizzled::Time_zone_system::get_name ( ) const [virtual]

Get name of time zone.

Returns:
Name of time zone as String

Implements drizzled::Time_zone.

Definition at line 121 of file tztime.cc.

References drizzled::tz_SYSTEM_name.

void drizzled::Time_zone_system::gmt_sec_to_TIME ( type::Time tmp,
type::Time::epoch_t  t 
) const [virtual]

Converts time from UTC seconds since Epoch (type::Time::epoch_t) representation to system local time zone broken-down representation.

Parameters:
tmppointer to type::Time structure to fill-in
ttype::Time::epoch_t value to be converted

Note: We assume that value passed to this function will fit into type::Time::epoch_t range supported by localtime_r. This conversion is putting restriction on TIMESTAMP range in MySQL. If we can get rid of SYSTEM time zone at least for interaction with client then we can extend TIMESTAMP range down to the 1902 easily.

Implements drizzled::Time_zone.

Definition at line 107 of file tztime.cc.

type::Time::epoch_t drizzled::Time_zone_system::TIME_to_gmt_sec ( const type::Time t,
bool *  in_dst_time_gap 
) const [virtual]

Converts local time in system time zone in type::Time representation to its type::Time::epoch_t representation.

This method uses system function (localtime_r()) for conversion local time in system time zone in type::Time structure to its type::Time::epoch_t representation. Unlike the same function for Time_zone_db class it it won't handle unnormalized input properly. Still it will return lowest possible type::Time::epoch_t in case of ambiguity or if we provide time corresponding to the time-gap.

You should call init_time() function before using this function.

Parameters:
tpointer to type::Time structure with local time in broken-down representation.
in_dst_time_gappointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap) and is not touched otherwise.
Returns:
Corresponding type::Time::epoch_t value or 0 in case of error

Implements drizzled::Time_zone.

Definition at line 83 of file tztime.cc.


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