VBScript Hour Function

Definition and Usage

The Hour function can return a number representing the hour of the day between 0 and 23.

Syntax

Hour(time)
Parameter Description
time Required. Any expression that can represent time.

Instance

Example 1

T = #1/15/2002 10:07:47 AM#
document.write(Hour(T))

Output:

10

Example 2

T = #10:07:47 AM#
document.write(Hour(T))

Output:

10