From a date/time object, gets the year value.
The year value of date.
Year(date) |
Parameter |
Description |
|---|---|
date |
A date/time object in the range 100 AD-9999 AD. |
When passing a date as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date.
<cfscript>
myDateTime = now();
WriteOutput(Year(myDateTime & "<br/>"));
</cfscript>
Output
2018
Sign in to your account