Whatever message this page gives is out now! Go check it out!

Year

Last update:
May 18, 2026

Description

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

Returns

The year value of date.

Category

Function syntax

Year(date)

See also

Parameters

Parameter
Description
date
A date/time object in the range 100 AD-9999 AD.

Usage

When passing a date as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date.

Example

<cfscript>
    myDateTime = now();
    WriteOutput(Year(myDateTime & "<br/>"));
</cfscript>
Output
2018

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page