|
struct | MYSQL_TIME_STATUS |
| Structure to return status from str_to_datetime(), str_to_time(), number_to_datetime(), number_to_time() More...
|
|
struct | MYSQL_TIME_STATUS::DEPRECATION |
|
struct | Interval |
| Struct representing a duration. More...
|
|
enum | interval_type {
INTERVAL_YEAR
, INTERVAL_QUARTER
, INTERVAL_MONTH
, INTERVAL_WEEK
,
INTERVAL_DAY
, INTERVAL_HOUR
, INTERVAL_MINUTE
, INTERVAL_SECOND
,
INTERVAL_MICROSECOND
, INTERVAL_YEAR_MONTH
, INTERVAL_DAY_HOUR
, INTERVAL_DAY_MINUTE
,
INTERVAL_DAY_SECOND
, INTERVAL_HOUR_MINUTE
, INTERVAL_HOUR_SECOND
, INTERVAL_MINUTE_SECOND
,
INTERVAL_DAY_MICROSECOND
, INTERVAL_HOUR_MICROSECOND
, INTERVAL_MINUTE_MICROSECOND
, INTERVAL_SECOND_MICROSECOND
,
INTERVAL_LAST
} |
| Available interval types used in any statement. More...
|
|
using | my_time_flags_t = unsigned int |
| Flags to str_to_datetime and number_to_datetime. More...
|
|
const unsigned long long int | log_10_int [20] |
|
const unsigned char | days_in_month [] |
|
const char | my_zero_datetime6 [] |
|
constexpr const bool | HAVE_64_BITS_TIME_T = sizeof(time_t) == sizeof(my_time_t) |
|
constexpr const int | MYTIME_MAX_YEAR = HAVE_64_BITS_TIME_T ? 9999 : 2038 |
| Time handling defaults. More...
|
|
constexpr const int | TIMESTAMP_MAX_YEAR = 2038 |
|
constexpr const int | YY_PART_YEAR = 70 |
| Two-digit years < this are 20XX; >= this are 19XX. More...
|
|
constexpr const int | MYTIME_MIN_YEAR = (1900 + YY_PART_YEAR - 1) |
|
constexpr const my_time_t | MYTIME_MAX_VALUE |
| max seconds from epoch of host's time_t stored in my_time_t Windows allows up to 3001-01-18 23:59:59 UTC for localtime_r, so that is our effective limit, although Unixen allow higher time points. More...
|
|
constexpr const int | MYTIME_MIN_VALUE = 0 |
| Zero represents the first time value we allow, i.e. More...
|
|
constexpr const std::int64_t | TYPE_TIMESTAMP_MAX_VALUE |
| max seconds from epoch that can be stored in a column of type TIMESTAMP. More...
|
|
constexpr const std::int64_t | TYPE_TIMESTAMP_MIN_VALUE = 1 |
|
constexpr const my_time_flags_t | TIME_FUZZY_DATE = 1 |
| Allow zero day and zero month. More...
|
|
constexpr const my_time_flags_t | TIME_DATETIME_ONLY = 2 |
| Only allow full datetimes. More...
|
|
constexpr const my_time_flags_t | TIME_FRAC_TRUNCATE = 4 |
|
constexpr const my_time_flags_t | TIME_NO_DATE_FRAC_WARN = 8 |
|
constexpr const my_time_flags_t | TIME_NO_ZERO_IN_DATE = 16 |
| Don't allow zero day or zero month. More...
|
|
constexpr const my_time_flags_t | TIME_NO_ZERO_DATE = 32 |
| Don't allow 0000-00-00 date. More...
|
|
constexpr const my_time_flags_t | TIME_INVALID_DATES = 64 |
| Allow 2000-02-31. More...
|
|
constexpr const my_time_flags_t | TIME_STRICT_COLON = 128 |
| Allow only HH:MM:SS or MM:SS time formats. More...
|
|
constexpr const int | MYSQL_TIME_WARN_TRUNCATED = 1 |
| Conversion warnings. More...
|
|
constexpr const int | MYSQL_TIME_WARN_OUT_OF_RANGE = 2 |
|
constexpr const int | MYSQL_TIME_WARN_INVALID_TIMESTAMP = 4 |
|
constexpr const int | MYSQL_TIME_WARN_ZERO_DATE = 8 |
|
constexpr const int | MYSQL_TIME_NOTE_TRUNCATED = 16 |
|
constexpr const int | MYSQL_TIME_WARN_ZERO_IN_DATE = 32 |
|
constexpr const int | MYSQL_TIME_WARN_DATETIME_OVERFLOW = 64 |
|
constexpr const int64_t | SECONDS_IN_24H = 86400LL |
| Useful constants. More...
|
|
constexpr const int | TIME_MAX_HOUR = 838 |
| Limits for the TIME data type. More...
|
|
constexpr const int | TIME_MAX_MINUTE = 59 |
|
constexpr const int | TIME_MAX_SECOND = 59 |
|
constexpr const int | TIME_MAX_VALUE |
| Note that this MUST be a signed type, as we use the unary - operator on it. More...
|
|
constexpr const int | TIME_MAX_VALUE_SECONDS |
|
constexpr const int | DATETIME_MAX_DECIMALS = 6 |
|
constexpr const int | SECS_PER_MIN = 60 |
|
constexpr const int | MINS_PER_HOUR = 60 |
|
constexpr const int | HOURS_PER_DAY = 24 |
|
constexpr const int | DAYS_PER_WEEK = 7 |
|
constexpr const int | DAYS_PER_NYEAR = 365 |
|
constexpr const int | DAYS_PER_LYEAR = 366 |
|
constexpr const int | SECS_PER_HOUR = (SECS_PER_MIN * MINS_PER_HOUR) |
|
constexpr const int | SECS_PER_DAY = (SECS_PER_HOUR * HOURS_PER_DAY) |
|
constexpr const int | MONS_PER_YEAR = 12 |
|
constexpr const int | MAX_TIME_ZONE_HOURS = 14 |
|
constexpr const unsigned int | WEEK_MONDAY_FIRST = 1 |
| Flags for calc_week() function. More...
|
|
constexpr const unsigned int | WEEK_YEAR = 2 |
|
constexpr const unsigned int | WEEK_FIRST_WEEKDAY = 4 |
|
constexpr const int64_t | MAX_DAY_NUMBER = 3652424 |
| Daynumber from year 0 to 9999-12-31. More...
|
|
constexpr const std::size_t | MAX_DATE_STRING_REP_LENGTH |
| Required buffer length for my_time_to_str, my_date_to_str, my_datetime_to_str and TIME_to_string functions. More...
|
|
void | my_init_time () |
| Prepare offset of system time zone from UTC for my_system_gmt_sec() func. More...
|
|
long | calc_daynr (unsigned int year, unsigned int month, unsigned int day) |
| Calculate nr of day since year 0 in new date-system (from 1615). More...
|
|
unsigned int | calc_days_in_year (unsigned int year) |
| Calc days in one year. More...
|
|
unsigned int | year_2000_handling (unsigned int year) |
| Handle 2 digit year conversions. More...
|
|
bool | time_zone_displacement_to_seconds (const char *str, size_t length, int *result) |
| Parses a time zone displacement string on the form {+-}HH:MM , converting to seconds. More...
|
|
void | get_date_from_daynr (int64_t daynr, unsigned int *year, unsigned int *month, unsigned int *day) |
| Change a daynr to year, month and day. More...
|
|
int | calc_weekday (long daynr, bool sunday_first_day_of_week) |
| Calc weekday from daynr. More...
|
|
bool | valid_period (long long int period) |
|
uint64_t | convert_period_to_month (uint64_t period) |
| Calculate month from period. More...
|
|
uint64_t | convert_month_to_period (uint64_t month) |
| Convert month to period. More...
|
|
bool | is_time_t_valid_for_timestamp (time_t x) |
| Check for valid my_time_t value. More...
|
|
unsigned int | calc_week (const MYSQL_TIME &l_time, unsigned int week_behaviour, unsigned int *year) |
| Calculate the week number from a MYSQL_TIME value. More...
|
|
bool | check_date (const MYSQL_TIME <ime, bool not_zero_date, my_time_flags_t flags, int *was_cut) |
| Check datetime value for validity according to flags. More...
|
|
bool | str_to_datetime (const char *str, std::size_t length, MYSQL_TIME *l_time, my_time_flags_t flags, MYSQL_TIME_STATUS *status) |
| Convert a timestamp string to a MYSQL_TIME value. More...
|
|
long long int | number_to_datetime (long long int nr, MYSQL_TIME *time_res, my_time_flags_t flags, int *was_cut) |
| Convert datetime value specified as number to broken-down TIME representation and form value of DATETIME type as side-effect. More...
|
|
bool | number_to_time (long long int nr, MYSQL_TIME *ltime, int *warnings) |
| Convert number to TIME. More...
|
|
unsigned long long int | TIME_to_ulonglong_datetime (const MYSQL_TIME &my_time) |
| Convert time value to integer in YYYYMMDDHHMMSS. More...
|
|
unsigned long long int | TIME_to_ulonglong_date (const MYSQL_TIME &my_time) |
| Convert MYSQL_TIME value to integer in YYYYMMDD format. More...
|
|
unsigned long long int | TIME_to_ulonglong_time (const MYSQL_TIME &my_time) |
| Convert MYSQL_TIME value to integer in HHMMSS format. More...
|
|
unsigned long long int | TIME_to_ulonglong (const MYSQL_TIME &my_time) |
| Convert struct MYSQL_TIME (date and time split into year/month/day/hour/... to a number in format YYYYMMDDHHMMSS (DATETIME), YYYYMMDD (DATE) or HHMMSS (TIME). More...
|
|
unsigned long long int | TIME_to_ulonglong_datetime_round (const MYSQL_TIME &my_time, int *warnings) |
| Round MYSQL_TIME datetime value and convert to ulonglong representation. More...
|
|
unsigned long long int | TIME_to_ulonglong_time_round (const MYSQL_TIME &my_time) |
| Round MYSQL_TIME time value and convert to to ulonglong representation. More...
|
|
unsigned long long int | TIME_to_ulonglong_round (const MYSQL_TIME &my_time, int *warnings) |
| Round any MYSQL_TIME timepoint and convert to ulonglong. More...
|
|
double | TIME_microseconds (const MYSQL_TIME &my_time) |
| Extract the microsecond part of a MYSQL_TIME struct as an n * (1/10^6) fraction as a double. More...
|
|
double | TIME_to_double_datetime (const MYSQL_TIME &my_time) |
| Convert a MYSQL_TIME datetime to double where the integral part is the timepoint as an ulonglong, and the fractional part is the fraction of the second. More...
|
|
double | TIME_to_double_time (const MYSQL_TIME &my_time) |
| Convert a MYSQL_TIME time to double where the integral part is the timepoint as an ulonglong, and the fractional part is the fraction of the second. More...
|
|
double | TIME_to_double (const MYSQL_TIME &my_time) |
| Convert a MYSQL_TIME to double where the integral part is the timepoint as an ulonglong, and the fractional part is the fraction of the second. More...
|
|
long long int | my_packed_time_get_frac_part (long long int i) |
| Return the fraction of the second as the number of microseconds. More...
|
|
long long int | year_to_longlong_datetime_packed (long year) |
| Convert year to packed numeric date representation. More...
|
|
long long int | TIME_to_longlong_datetime_packed (const MYSQL_TIME &my_time) |
| Convert datetime to packed numeric datetime representation. More...
|
|
long long int | TIME_to_longlong_date_packed (const MYSQL_TIME &my_time) |
| Convert date to packed numeric date representation. More...
|
|
long long int | TIME_to_longlong_time_packed (const MYSQL_TIME &my_time) |
| Convert time value to numeric packed representation. More...
|
|
long long int | TIME_to_longlong_packed (const MYSQL_TIME &my_time) |
| Convert a temporal value to packed numeric temporal representation, depending on its time_type. More...
|
|
void | TIME_from_longlong_datetime_packed (MYSQL_TIME *ltime, long long int nr) |
| Convert packed numeric datetime representation to MYSQL_TIME. More...
|
|
void | TIME_from_longlong_time_packed (MYSQL_TIME *ltime, long long int nr) |
| Convert time packed numeric representation to time. More...
|
|
void | TIME_from_longlong_date_packed (MYSQL_TIME *ltime, long long int nr) |
| Convert packed numeric date representation to MYSQL_TIME. More...
|
|
void | TIME_set_yymmdd (MYSQL_TIME *ltime, unsigned int yymmdd) |
| Set day, month and year from a number. More...
|
|
void | TIME_set_hhmmss (MYSQL_TIME *ltime, unsigned int hhmmss) |
| Set hour, minute and secondr from a number. More...
|
|
void | my_datetime_packed_to_binary (long long int nr, unsigned char *ptr, unsigned int dec) |
| Store in-memory numeric packed datetime representation to disk. More...
|
|
long long int | my_datetime_packed_from_binary (const unsigned char *ptr, unsigned int dec) |
| Convert on-disk datetime representation to in-memory packed numeric representation. More...
|
|
void | my_time_packed_to_binary (long long int nr, unsigned char *ptr, unsigned int dec) |
| Convert in-memory numeric time representation to on-disk representation. More...
|
|
long long int | my_time_packed_from_binary (const unsigned char *ptr, unsigned int dec) |
| Convert on-disk time representation to in-memory packed numeric representation. More...
|
|
void | my_timestamp_to_binary (const my_timeval *tm, unsigned char *ptr, unsigned int dec) |
| Convert in-memory timestamp representation to on-disk representation. More...
|
|
void | my_timestamp_from_binary (my_timeval *tm, const unsigned char *ptr, unsigned int dec) |
| Convert binary timestamp representation to in-memory representation. More...
|
|
bool | str_to_time (const char *str, std::size_t length, MYSQL_TIME *l_time, MYSQL_TIME_STATUS *status, my_time_flags_t flags=0) |
| Convert a time string to a MYSQL_TIME struct. More...
|
|
bool | check_time_mmssff_range (const MYSQL_TIME &my_time) |
| Check if TIME fields can be adjusted to make the time value valid. More...
|
|
bool | check_time_range_quick (const MYSQL_TIME &my_time) |
| Check TIME range. More...
|
|
bool | check_datetime_range (const MYSQL_TIME &my_time) |
| Check datetime, date, or normalized time (i.e. More...
|
|
void | adjust_time_range (MYSQL_TIME *, int *warning) |
| Adjust 'time' value to lie in the MYSQL_TIME range. More...
|
|
bool | validate_my_time (const MYSQL_TIME &my_time) |
| Check whether the argument holds a valid UNIX time value (seconds after epoch). More...
|
|
my_time_t | my_system_gmt_sec (const MYSQL_TIME &my_time, my_time_t *my_timezone, bool *in_dst_time_gap) |
| Convert time in MYSQL_TIME representation in system time zone to its my_time_t form (number of seconds in UTC since beginning of Unix Epoch). More...
|
|
void | set_zero_time (MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) |
| Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000. More...
|
|
void | set_max_time (MYSQL_TIME *tm, bool neg) |
| Set MYSQL_TIME variable to maximum time value. More...
|
|
void | set_max_hhmmss (MYSQL_TIME *tm) |
| Set hour, minute and second of a MYSQL_TIME variable to maximum time value. More...
|
|
int | my_time_to_str (const MYSQL_TIME &my_time, char *to, unsigned int dec) |
| Converts a time value to a string with the format HH:MM:SS[.fraction]. More...
|
|
int | my_date_to_str (const MYSQL_TIME &my_time, char *to) |
| Converts a date value to a string with the format 'YYYY-MM-DD'. More...
|
|
int | my_datetime_to_str (const MYSQL_TIME &my_time, char *to, unsigned int dec) |
| Print a datetime value with an optional fractional part. More...
|
|
int | my_TIME_to_str (const MYSQL_TIME &my_time, char *to, unsigned int dec) |
| Convert struct DATE/TIME/DATETIME value to string using built-in MySQL time conversion formats. More...
|
|
void | my_date_to_binary (const MYSQL_TIME *ltime, unsigned char *ptr) |
| Convert in-memory date representation to on-disk representation. More...
|
|
int | my_timeval_to_str (const my_timeval *tm, char *to, unsigned int dec) |
| Print a timestamp with an oprional fractional part: XXXXX[.YYYYY]. More...
|
|
bool | date_add_interval (MYSQL_TIME *ltime, interval_type int_type, Interval interval, int *warnings) |
| Add an interval to a MYSQL_TIME struct. More...
|
|
long | my_time_fraction_remainder (long nr, unsigned int decimals) |
| Round the input argument to the specified precision by computing the remainder modulo log10 of the difference between max and desired precision. More...
|
|
void | my_time_trunc (MYSQL_TIME *ltime, unsigned int decimals) |
| Truncate the number of microseconds in MYSQL_TIME::second_part to the desired precision. More...
|
|
void | my_datetime_trunc (MYSQL_TIME *ltime, unsigned int decimals) |
| Alias for my_time_trunc. More...
|
|
void | my_timeval_trunc (my_timeval *tv, unsigned int decimals) |
| Truncate the tv_usec member of a posix timeval struct to the specified number of decimals. More...
|
|
bool | check_fuzzy_date (const MYSQL_TIME &my_time, my_time_flags_t fuzzydate) |
| Predicate for fuzzyness of date. More...
|
|
bool | non_zero_date (const MYSQL_TIME &my_time) |
| Predicate which returns true if at least one of the date members are non-zero. More...
|
|
bool | non_zero_time (const MYSQL_TIME &my_time) |
| Predicate which returns true if at least one of the time members are non-zero. More...
|
|
void | datetime_to_time (MYSQL_TIME *ltime) |
| "Casts" MYSQL_TIME datetime to a MYSQL_TIME time. More...
|
|
void | datetime_to_date (MYSQL_TIME *ltime) |
| "Casts" MYSQL_TIME datetime to a MYSQL_TIME date. More...
|
|
void | date_to_datetime (MYSQL_TIME *ltime) |
| "Casts" a MYSQL_TIME to datetime by setting MYSQL_TIME::time_type to MYSQL_TIMESTAMP_DATETIME. More...
|
|
bool | time_add_nanoseconds_with_truncate (MYSQL_TIME *ltime, unsigned int nanoseconds, int *warnings) |
| Add nanoseconds to a time value with truncation. More...
|
|
bool | datetime_add_nanoseconds_with_truncate (MYSQL_TIME *ltime, unsigned int nanoseconds) |
| Add nanoseconds to a datetime value with truncation. More...
|
|
bool | time_add_nanoseconds_with_round (MYSQL_TIME *ltime, unsigned int nanoseconds, int *warnings) |
| Add nanoseconds to a time value with rounding. More...
|
|
bool | datetime_add_nanoseconds_with_round (MYSQL_TIME *ltime, unsigned int nanoseconds, int *warnings) |
| Add nanoseconds to a datetime value with rounding. More...
|
|
bool | time_add_nanoseconds_adjust_frac (MYSQL_TIME *ltime, unsigned int nanoseconds, int *warnings, bool truncate) |
| Add nanoseconds to time and round or truncate as indicated by argument. More...
|
|
bool | datetime_add_nanoseconds_adjust_frac (MYSQL_TIME *ltime, unsigned int nanoseconds, int *warnings, bool truncate) |
| Add nanoseconds to datetime and round or truncate as indicated by argument. More...
|
|
bool | my_time_adjust_frac (MYSQL_TIME *ltime, unsigned int dec, bool truncate) |
| Round/Truncate time value to the given precision. More...
|
|
bool | my_datetime_adjust_frac (MYSQL_TIME *ltime, unsigned int dec, int *warnings, bool truncate) |
| Round/Truncate datetime value to the given precision. More...
|
|
bool | my_timeval_round (my_timeval *tv, unsigned int decimals) |
| Round timeval value to the given precision. More...
|
|
void | mix_date_and_time (MYSQL_TIME *ldate, const MYSQL_TIME &my_time) |
| Mix a date value and a time value. More...
|
|
void | localtime_to_TIME (MYSQL_TIME *to, const struct tm *from) |
| Converts a timepoint in a posix tm struct to a MYSQL_TIME struct. More...
|
|
void | calc_time_from_sec (MYSQL_TIME *to, long long int seconds, long microseconds) |
| Initialize MYSQL_TIME with MYSQL_TIMESTAMP_TIME from given number of seconds and microseconds. More...
|
|
bool | calc_time_diff (const MYSQL_TIME &my_time1, const MYSQL_TIME &my_time2, int l_sign, long long int *seconds_out, long *microseconds_out) |
| Calculate difference between two datetime values as seconds + microseconds. More...
|
|
int | my_time_compare (const MYSQL_TIME &my_time_a, const MYSQL_TIME &my_time_b) |
| Compare tow MYSQL_TIME objects. More...
|
|
long long int | TIME_to_longlong_packed (const MYSQL_TIME &my_time, enum enum_field_types type) |
| Convert MYSQL_TIME value to its packed numeric representation, using field type. More...
|
|
void | TIME_from_longlong_packed (MYSQL_TIME *ltime, enum enum_field_types type, long long int packed_value) |
| Convert packed numeric temporal representation to time, date or datetime, using field type. More...
|
|
long long int | longlong_from_datetime_packed (enum enum_field_types type, long long int packed_value) |
| Convert packed numeric representation to unpacked numeric representation. More...
|
|
double | double_from_datetime_packed (enum enum_field_types type, long long int packed_value) |
| Convert packed numeric temporal representation to unpacked numeric representation. More...
|
|