Retrieve the hour component of a datetime.
| SELECT HOUR(“2017-06-20 09:34:00”); |
The HOUR() function retrieves the hour part from a given date, ranging from 0 to 838.
| HOUR(datetime) |
|
Parameter |
Description |
|
datetime |
Required: The datetime value from which to extract the hour. |
|
Works in: |
From MySQL version 4.0 |
Retrieve the hour component from a datetime.
| SELECT HOUR(“838:59:59”); |