TIME()

Overview

Returns the time part of a time-containing expression.

USAGE

TIME(expr)

Argument Name

Description

expr

The time-containing expression to evaluate

DETAILS

TIME() is a date-time function that returns the time portion of a time-containing expression.

When the argument is a string, it can have a DATETIME format of YYYY-MM-DD hh:mm:ss or a TIME format of hh:mm:ss (and similar). Both support optional fractional seconds after a decimal point with up to 6 digits of accuracy.

When the argument is numeric, it can be an integer or floating-point number with the integer portion in the format HHMMSS.

When a time is specified without a date, it is OK for the hours portion of the value to exceed 24.

In string context, the return value is in the hh:mm:ss.uuuuuu format. The 6-digit microsecond value is always included after the decimal point, even if no microseconds were specified in an input value.

In numeric context, the return value is in the hhmmss.us format. The value is always floating point, even when microseconds were not specified in the input.

A NULL is returned if argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT TIME('2019-01-31 10:01:00');
+-----------------------------+
| TIME('2019-01-31 10:01:00') |
+-----------------------------+
| 10:01:00.000000             |
+-----------------------------+
SELECT TIME('12:34:56') + 0;
+----------------------+
| TIME('12:34:56') + 0 |
+----------------------+
|          123456.0000 |
+----------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES