year

From a date/time object, gets the year value.

year(date) → returns Numeric

Member Function Syntax

date.year()

year Argument Reference

date
Required

Compatibility

ColdFusion:

Member function is available in CF 11+.

Lucee:

Member function is available in Lucee 4.5+.

Examples sample code invoking the year function


Year of a datatime object

dt = createdatetime(2016,1,1,5,30,25);
y = year( dt );
writeoutput( y );

Expected Result: 2016


Fork me on GitHub