HOUR()

Overview

Returns the hour for a TIME or DATETIME argument.

USAGE

HOUR(time)

Argument Name

Description

time

The time of day to measure

DETAILS

HOUR() is date-time function that returns the hour of the time argument.

The date can be specifies as a data type that includes a time, a string, that can be parsed as a time-including data type (including hh:mm), or a hhmmss number.

The integer value returned is in the range 0 to 23.

A NULL is returned if the argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT HOUR('01:00:10'), HOUR('00:53'), HOUR(123456);
+------------------+---------------+--------------+
| HOUR('01:00:10') | HOUR('00:53') | HOUR(123456) |
+------------------+---------------+--------------+
|                1 |             0 |           12 |
+------------------+---------------+--------------+
SELECT HOUR('2022-01-01 23:42:42 and such');
+--------------------------------------+
| HOUR('2022-01-01 23:42:42 and such') |
+--------------------------------------+
|                                   23 |
+--------------------------------------+

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