MAKETIME()

Overview

Returns a time value constructed from separate hour, minute, and second values.

USAGE

MAKETIME(hours, minutes, seconds)

Argument Name

Description

hours

The number representing the hours past midnight

minutes

The number of minutes past the hour

seconds

The number of seconds past the minute

DETAILS

MAKETIME() is a date-time function that returns a time value from separate arguments for hours, minutes, and seconds.

The seconds can be specified as a fractional value to specify sub-second precision.

In string context, the return value is in the hh:mm:ss format. Fractional seconds are appended after a decimal point.

In numeric context, the return value is in the hhmmss format. Fractional seconds transform the integer value into floating point.

A NULL is returned if any argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT MAKETIME(10, 20, 30) AS result_1,
       MAKETIME(10, 20, 30.40) AS result_2;
+-----------------+-----------------+
| result_1        | result_2        |
+-----------------+-----------------+
| 10:20:30.000000 | 10:20:30.000000 |
+-----------------+-----------------+
SELECT MAKETIME(10, 20, 30) + 0 AS result_1,
       MAKETIME(10, 20, 30.40) + 0 AS result_2;
+-------------+-------------+
| result_1    | result_2    |
+-------------+-------------+
| 102030.0000 | 102030.0000 |
+-------------+-------------+
SELECT MAKETIME(10, 00, 61);
+----------------------+
| MAKETIME(10, 00, 61) |
+----------------------+
| NULL                 |
+----------------------+

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