When dates start bugging you and causing you to write a lot of code,
remember that they are just numbers to CF.

<cfloop from="12/31/2001" to="1/31/2002" index="i">
        <cfoutput>#dateformat(i, "m/d/yy")# -- #i#<br></cfoutput>
</cfloop>

Dan
President and CEO of the Date-Time Liberation Army (DTLA)

"Dates deserve to be treated just like numbers, ah ha ha."
The Count


-----Original Message-----
From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 5:25 AM
To: CF-Talk
Subject: No easy way to loop through a date range?


My wife needed help writing a template so that she could put together a
regular and on-call schedule for work.  Pretty simple requiremenets, really,
she just asked me to generate a table that dumped out a range of dates.
Easy-peasy, thinks I, I bet Cold Fusion can do it in 3 lines of code.

Wrong.  Not especially difficult, and I worked it out (using CFLOOP, and a
bunch of variables for current day, lastdayofyear(), etc.), but it left me
wondering why <cfloop> didn't allow you to loop through a date object and
increment by days, hours, minutes, whatever?

Thanks

Pete


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to