HOUR function [Date and time]

Function

Returns a number from 0 to 23 corresponding to the hour component of the specified date/time.

Syntax

HOUR ( datetime-expression )

Parameters

datetime-expression The date/time.

Example

The following statement returns the value 21:

SELECT HOUR( '1998-07-09 21:12:13' ) FROM iq_dummy

Standards and compatibility