Visual Basic Scripting Edition  

Year Function

Returns a whole number representing the year.

Year(date)

The date argument is any expression that can represent a date. If date contains Null, Null is returned.

Remarks

The following example uses the Year function to obtain the year from a specified date:

Dim MyDate, MyYear
MyDate = #October 19, 1962#   ' Assign a date.
MyYear = Year(MyDate)         ' MyYear contains 1962.

Requirements

Version 1

See Also

Date Function | Day Function | Month Function | Now Function | Weekday Function