hour

Returns the hour field of a date/timestamp.

Example

Extract the hour field from December 24, 2001 11:55:12.000.

hour(timestamp("2001-12-24 23:55:12.000"))

This example produces 23.

Syntax

hour(timestamp expr t)
  • t : expression evaluating to timestamp

    Returns

    int

Notes

hour takes a timestamp value and returns the hour field from it as an int.