Skip to content

HOUR

  • time: This parameter represents the exact time value from which the hour is to be extracted. It accepts a string formatted as a time (e.g., ‘15
SELECT HOUR('15:30:00') AS 'Hour';
+------+
| Hour |
+------+
| 15 |
+------+

The HOUR function in MySQL is used to get the hour from a time. In the example, input time ‘15:30:00’ was passed to the HOUR function, and this returned 15, which is the hour in the provided time.