Whatever message this page gives is out now! Go check it out!
<cfloop
from = "start time"
to = "end time"
index = "current value"
step = "increment">
</cfloop>Attribute | Req/Opt | Default | Description |
fromDate | Required | The beginning of the date or time range. | |
toDate | Required | The end of the date or time range. | |
index | Required | Numeric index value. ColdFusion sets it to the numeric equivalent of the from value and increments by the numeric equivalent of the step value, until it equals the numeric equivalent of the to value. | |
step | Optional | 1 day | Step, expressed as a timespan, by which the index increments. |
<cfset fromDate = Now()>
<cfset toDate = Now() + 30>
<cfloop from="#fromDate#" to="#toDate#" index="i" step="#CreateTimeSpan(7,0,0,0)#">
<cfoutput>#dateformat(i, "mm/dd/yyyy")#<br /></cfoutput>
</cfloop><cfset fromDate = Now()>
<cfset toDate = Now() + 30>
<cfloop from="#fromDate#" to="#toDate#" index="i" step="#CreateTimeSpan(7,0,0,0)#">
<cfset i = dateAdd("d", 0, i)><!--- converts number to date --->
<cfoutput>#i.dateTimeFormat("mm/dd/yyyy")#</cfoutput>
</cfloop><cfset startTime = CreateTime(0,0,0)>
<cfset endTime = CreateTime(23,59,59)>
<cfloop from="#startTime#" to="#endTime#" index="i" step="#CreateTimeSpan(0,0,30,0)#">
<cfoutput>#TimeFormat(i, "hh:mm tt")#<br /></cfoutput>
</cfloop>