Skip to main content



Hour Function

The Hour function returns the hour of the day for a given DateTime (0 to 23).

Syntax 1

Hour()

The Hour function returns the hour of the day for a given DateTime (0 to 23).

Syntax 2

Hour(dateTime)

The Hour function returns the hour of the day for a given DateTime (0 to 23).

Arguments

dateTime DateTime - A date-time.

Remarks

  • If a Date (not a DateTime) is passed, the function returns 0.

Example:

Hour("2005-1-28"); // returns 0

Example:

Hour("2005-1-28T22:10:45"); // returns 22