This tutorial explains how to use the MySQL HOUR function with syntax and examples.
The MySQL HOUR function returns the hour portion of a date value.
The syntax for the HOUR function in MySQL is:
The time or datetime value from which to extract the hour.
The HOUR function can be used in the following versions of MySQL:
Let's look at some MySQL HOUR function examples and explore how to use the HOUR function in MySQL.
For example:
This last HOUR example would display the hour portion of the current system time (current system time is returned by the CURTIME function).