VBScript Hour function

Definition and usage

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

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