Latest web development tutorials

VBScript Hour function

VBScript Reference Complete VBScript Reference

Hour function returns a number representative of the number of hours a day between 0-23.

grammar

Hour(time)

参数 描述
time 必需。任何可表示时间的表达式。

Examples

Example 1

<script type="text/vbscript">

document.write(Hour("13:45"))

</script>

Examples of the above output:

13

try it"

Example 2

<script type="text/vbscript">

document.write(Hour(Now()))

</script>

Examples of the above output:

document.write(Hour(Now()))

try it"

VBScript Reference Complete VBScript Reference