VBScript Year Function

Definition and Usage

The Year function can return a number representing the year.

Syntax

Year(date)
Parameter Description
date Required. Any expression that can represent a date.

Instance

Example 1

D = #2007/10/1#
document.write(Year(D))

Output:

2007