daysInYear

Determines the number of days in a year.

daysInYear(date) → returns Numeric

Member Function Syntax

date.daysInYear()

daysInYear Argument Reference

date
Required

Date or date/time object.

Compatibility

ColdFusion:

Member function is available in CF 11+.

Lucee:

Member function is available in Lucee 4.5+.

Examples sample code invoking the daysInYear function


Simple example

Uses the daysInYear function to determine the number of days in a year

<cfset result = daysInYear(now())>
<cfoutput>#result#</cfoutput>

Expected Result: 365


Simple example with leap year

To determine the number of days in a year

<cfset Date = CreateDate(2012, 02, 03)>
<cfset result = daysInYear(Date)>
<cfoutput>#result#</cfoutput>

Expected Result: 366


Fork me on GitHub