HOUR: Obtaining the Hour From Time/Timestamp

How to:

The HOUR function returns the hour field from a time or timestamp value.


Top of page

x
Syntax: How to Obtain the Hour From a Time or Timestamp
HOUR(arg)

where:

arg

Time or timestamp

Is the input value.

This function returns an integer value.



Example: Obtaining the Hour From a Time or Timestamp

HOUR returns the hour from a time or timestamp. This example,

HOUR('11:22:33')

returns 11.

This example,

HOUR('2001-01-22 10:00:00')

returns 10.


iWay Software