Not yet rated

Problem

Need to output the next 12 months for reporting.

Solution

Simple CF loop stepping through the months.

Detailed explanation

<cfloop from="0" to="11" index="i" step="1">

    <cfset displayMonth = dateAdd("m", 1 * i, now())>
       
        <cfoutput>#dateFormat(displayMonth,"mmmm yyyy")#<br></cfoutput>

</cfloop>


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes