Submitted by Joe Lippeatt on Thu, 10/07/2010 - 16:56
You could need a list of "Hours" for any number of reasons, for a select box, checkboxes, radio buttons, etc. In the following example, I create a list of "Hours" to run along the top of a table. What strikes me interesting about this code is that although it was written in 2001, its very adaptable to generating hour lists today.
Dim i, iOffSet
For i = 8 to 20
' ---- if past 12 noon,
If i > 12 Then iOffSet = -12
Response.Write "" & iOffset + i & ":00"