Please give your posts sensible titles ("My Homework" perhaps :)).
You have the basics but I would suggest the following:
- I'm sure they are expecting you to use a "for loop" to write the numbers.
- The result of d.getHours() is a number not a string so compare with 0 not "0" etc, string comparisons work differently.
- Store the results of the call to getHours(). If the hour changes during loading your results will look strange. Unlikely but possible.
- You don't need a while loop. Just check whether the hour falls into one category and if so run your for loop for 1 to 10, otherwise run the for loop for 20 to 30.
--
Joe (
Microsoft MVP - XML)