Determines the number of days in a month.
daysInMonth(date)
→ returns numeric
date.daysInMonth()
timezone
parameter.
Member function is available in Lucee4.5+.
Uses the daysInMonth function to determine the number of days in a month
<cfset Date = CreateDate(2012, 12, 30)>
<cfset result = daysInMonth(Date)>
<cfoutput>#result#</cfoutput>
Expected Result: 31
To determine the number of days in a month
<cfset Date = CreateDate(2012, 02, 03)>
<cfset result = daysInMonth(Date)>
<cfoutput>#result#</cfoutput>
Expected Result: 29
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.