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 String * | get_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) |
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.
const String * drizzled::Time_zone_system::get_name | ( | ) | const [virtual] |
Get name of time zone.
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.
tmp | pointer to type::Time structure to fill-in |
t | type::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.
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.
t | pointer to type::Time structure with local time in broken-down representation. |
in_dst_time_gap | pointer 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. |
Implements drizzled::Time_zone.