In MariaDB, HOUR() is a built-in date and time function that returns the hour from a given time expression.
It accepts one argument, which is the time you want to extract the hour from.
For time-of-day values, it returns the hour as a number in the range 0 to 23. However, the range of TIME values can be much larger, and therefore, the returned value can be much higher than 23.
The return value is always positive, even if a negative time is provided.