Hour Function

Returns a number between 0 and 23 representing the hour of the day of the specified time parameter.

Hour (time)

Parameters

Time  -  (Input, expression, Required)

The time value to extract the number of hours from. If time is specified as a string expression, Newlook will be convert it into a time as long as the string is in the form “hh:nn:ss” (it may also include a valid date, e.g. “Feb 1, 1999 10:30:00”).

Return Value

An integer between 0 and 23, or Error if time is not a valid time.

Examples

Hour ("4:35:17 AM")

Returns 4

Hour (“11:22:33”)

Returns 11

Hour (“Feb 1, 1999 11:22:33”)

Returns 11

Hour (Now ())

Returns the current hour of the day

Hour (Null)

Returns Error

Hour (Error)

Returns Error

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Day Function


© 2004-2021 looksoftware. All rights reserved.