VeloDB Cloud
SQL Manual
Functions
date-time-functions
hour

hour

Description

Syntax:

INT HOUR(DATETIME date)

This function fetches the hour information in the given date. The returned value ranges from 0 to 23.

The parameter is of DATE or DATETIME type.

Example

mysql> select hour('2018-12-31 23:59:59');
+-----------------------------+
| hour('2018-12-31 23:59:59') |
+-----------------------------+
|                          23 |
+-----------------------------+

Keywords

HOUR