This content has been marked as final. Show 6 replies
For the selection time, I would use 2 dropdowns, one for the hours, one for the minutes. You could use one, but it would be a very long list.
Use a text box for the time increment.
When processing the form, turn the start time into a date-time object with some date so that you can apply date functions to it. Then write the code to achieve whatever it is you are trying to do.
ok many thanks
so say i have start time of 08:00 and a increment of 40
how would i code to display every 40 mins?
Every 40 minutes for how long?
for every 40 mins that is in my table, so if my table of times goes til 9pm that would be the finish
something like this
<cfloop condition = "StartTime lt EndTime">
<cfset StartTime = dateadd("n", form.increment, StartTime)>
ok thanks for that got it working, i am trying to populate a list box but the time it is showing is 1 hour ahead of what it should be
IN MY TABLE
GetUser.starttime = 08:00:00
GetUser.EndTime = 12:00:00
GetUser.Increment = 60
so in my list box it should show times 08:00 to 12:00 but it shows 09:00 to 01:00
any ideas why this is?
<cfset steptime = GetUser.starttime>
<cfloop condition="DateCompare(StepTime, GetUser.EndTime) LT 1">
<cfset StepTime = dateadd("n", GetUser.Increment, StepTime)>
<option value="#TimeFormat(StepTime, "hh:mm:ss")#">#TimeFormat(StepTime, "hh:mm")#