18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifdef USE_PRAGMA_INTERFACE
22
#pragma interface /* gcc class interface */
26
This class represents abstract time zone and provides
27
basic interface for DRIZZLE_TIME <-> my_time_t conversion.
28
Actual time zones which are specified by DB, or via offset
23
This class represents abstract time zone and provides
24
basic interface for DRIZZLE_TIME <-> time_t conversion.
25
Actual time zones which are specified by DB, or via offset
29
26
or use system functions are its descendants.
31
class Time_zone: public Sql_alloc
28
class Time_zone: public Sql_alloc
34
31
Time_zone() {} /* Remove gcc warning */
36
Converts local time in broken down DRIZZLE_TIME representation to
37
my_time_t (UTC seconds since Epoch) represenation.
33
Converts local time in broken down DRIZZLE_TIME representation to
34
time_t (UTC seconds since Epoch) represenation.
38
35
Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
39
36
falls into spring time-gap (or lefts it untouched otherwise).
41
virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
38
virtual time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
42
39
bool *in_dst_time_gap) const = 0;
44
Converts time in my_time_t representation to local time in
41
Converts time in time_t representation to local time in
45
42
broken down DRIZZLE_TIME representation.
47
virtual void gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const = 0;
44
virtual void gmt_sec_to_TIME(DRIZZLE_TIME *tmp, time_t t) const = 0;
49
Because of constness of String returned by get_name() time zone name
46
Because of constness of String returned by get_name() time zone name
50
47
have to be already zeroended to be able to use String::ptr() instead
53
50
virtual const String * get_name() const = 0;
56
53
We need this only for surpressing warnings, objects of this type are
57
54
allocated on MEM_ROOT and should not require destruction.
62
59
extern Time_zone * my_tz_UTC;
63
60
extern Time_zone * my_tz_SYSTEM;
64
61
extern Time_zone * my_tz_OFFSET0;
65
extern Time_zone * my_tz_find(THD *thd, const String *name);
66
extern bool my_tz_init(THD *org_thd, const char *default_tzname, bool bootstrap);
62
extern Time_zone * my_tz_find(Session *session, const String *name);
63
extern bool my_tz_init(Session *org_session, const char *default_tzname);
67
64
extern void my_tz_free();
68
extern my_time_t sec_since_epoch_TIME(DRIZZLE_TIME *t);
65
extern time_t sec_since_epoch_TIME(DRIZZLE_TIME *t);