HOUR
Extracts the hour number (from 0 to 23) for a given time or timestamp.
Syntax
EXTRACT(HOUR FROM date_timestamp_expression string) → bigint
date_timestamp_expression: A
TIME
,TIMESTAMP
, orDATE
expression.
Examples
HOUR example using a timestamp.
HOUR example using a time.
HOUR example using the CAST function.
Usage Notes
This function uses the EXTRACT
function. When using the CAST
function, timestamps containing milliseconds are not allowed.
Last updated