CitectVBA Programming Reference > CitectVBA Function Reference > Date and Time Functions > Year

Year

Calculates the year from the given date argument passed to the function. Date values in CitectVBA are evaluated using the Gregorian Calendar.

Syntax

Year(Date)

Date:

A string or expression that can represent a date value. This includes any combination of date literals, numbers that look like dates, strings that look like dates, and dates from functions.

Return Value

Returns an integer representing a year 1930-2029 inclusive.

Related Functions

Date | Month| WeekDay| Day

Example

Dim varMyBDate, varMyYear
varMyDate = "08/07/58"
varMyYear = Year(varMyBDate)
' returns 1958