HOUR

Returns the number of hours from the DateTime value passed to the function. If the time is not passed to the function along with the date then the function returns the hours extracted from system time.

Syntax

= HOUR(value)

Parameters

value

A date time value from which the hours are to be extracted. The value can contain DateTime as a string (e.g. “02/19/2009 14:30:30.3”, "2009-02-19 14:30:30.3",

 "19 Feb 2009 2:30:30.3 PM ", "Thu, 19 Feb 2009”) or as a DateTime object.

Return Type

Integer

In the case of an error, the function displays an error message: “HOUR(value): Error message”

Examples

Example

Returns

= HOUR(“02/19/2009 14:30:30.3”)

14

= HOUR("2009-02-19 14:30:30.3")

14

= HOUR(“19 Feb 2009”)

The hours extracted from system time.

= HOUR(ShippedDate)

The hours extracted from the value of ShippedDate. If any entries are NULL then returns the hours extracted from system time.