- ⌂ Date & Time
- Functions
HOUR()
Return the hour part of a time or timestamp as an integer from 0-23.
Prototype
integer HOUR(mixed $timestamp)
Parameters
- timestamp - A time ("HH:MM:SS") or timestamp ("YYYY-MM-DD HH:MM:SS") with optional decimal and microseconds.
Return
The hour portion of a time or timestamp, or NULL if there is an error, such as an invalid timestamp.
Example
SELECT OID, HOUR('12:05:22.234') AS Hour FROM User