How to get the number of days in a month in ColdFusion

DaysInMonth() - get the number of days in a month

DaysInMonth.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DaysInMonth function example: how to get the number of days in a month</title>
</head>

<body>
<h2 style="color:hotpink">DaysInMonth Function Example</h2>

<cfset ToDay=DateFormat(Now(),"dd-mmm-yyyy")>

<cfoutput>
<b>
Today: #Today#
<br />
Number of days in this month: #DaysInMonth(ToDay)#
</b>
</cfoutput>
</body>
</html>





More ColdFusion examples