daysInYear

Determines the number of days in a year.

daysInYear(date) → returns numeric

Member Function Syntax

date.daysInYear()

daysInYear Argument Reference

date date
Required

Date or datetime object (100AD-9999AD).

Compatibility

ColdFusion:

Member function is available in CF11+.

Lucee:

Lucee allows an optional timezone parameter. Member function is available in Lucee4.5+.

Examples sample code invoking the daysInYear function

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

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

Expected Result: 365

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