65
74
#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \
66
75
TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)
77
enum enum_drizzle_timestamp_type
79
DRIZZLE_TIMESTAMP_NONE= -2, DRIZZLE_TIMESTAMP_ERROR= -1,
80
DRIZZLE_TIMESTAMP_DATE= 0, DRIZZLE_TIMESTAMP_DATETIME= 1, DRIZZLE_TIMESTAMP_TIME= 2
85
Structure which is used to represent datetime values inside Drizzle.
87
We assume that values in this structure are normalized, i.e. year <= 9999,
88
month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
89
in server such as my_system_gmt_sec() or make_time() family of functions
90
rely on this (actually now usage of make_*() family relies on a bit weaker
91
restriction). Also functions that produce DRIZZLE_TIME as result ensure this.
92
There is one exception to this rule though if this structure holds time
93
value (time_type == DRIZZLE_TIMESTAMP_TIME) days and hour member can hold
96
typedef struct st_drizzle_time
98
unsigned int year, month, day, hour, minute, second;
99
unsigned long second_part;
101
enum enum_drizzle_timestamp_type time_type;
68
105
bool check_date(const DRIZZLE_TIME *ltime, bool not_zero_date,
69
106
uint32_t flags, int *was_cut);
70
107
enum enum_drizzle_timestamp_type
154
191
INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST
194
extern uint64_t my_getsystime(void);
195
extern uint64_t my_micro_time(void);
196
extern uint64_t my_micro_time_and_time(time_t *time_arg);
157
199
#ifdef __cplusplus
161
#endif /* MYSYS_MY_TIME_H */
203
#endif /* DRIZZLED_MY_TIME_H */