Developer Documentation Library > Scripting > UNICOM Intelligence Function Library > Date and time functions > Year
 
Year
Returns a whole number representing the year.
Syntax
Year(Val)
Parameters
Val
Type: Date
The date for which you want to return the year.
(return)
Type: Long
The Year.
Remarks
This is equivalent to DatePart("yyyy", Val).
Example
This example uses the Year function to return the year from the date recorded in the DataCollection.FinishTime system variable. For example, if the date in the variable is 20 January 2023, this example returns 2023.
Year(DataCollection.FinishTime)
See also
DateAdd
Date and time functions