HOUR() Examples – MySQL

The MySQL HOUR() function is used to return the hour component from a time value.

The return value for a time-of-day value will be between 0 and 23, however the range returned by this function could be much larger, due to the fact that a time data type isn’t limited to just a time of day (it can also be used to represent elapsed time or a time interval between two events). This means that the returned value could be greater than 24 hours or even a negative value.

Continue reading