Hi, Im trying toi convert the 0-23 resut given back from the getHours method into 1-12. I used a for loop, but it seems to my && operater is not working, because seems to Dead cycle when i run it. What am I doing wrong? Is there a simpler way to do thins? Thanks, Drew
My code:
"Mistakes are the portals of discovery"
James Joyce
My code:
Code:
var curdate = new Date();
var hours = curdate.getHours();
var x = 0;
if (hours == 0)
hours = 1;
else
for (x = 1; hours >= 13 && hours <= 23; x++)
var hour = hours - x;
document.write(hour + "<BR>");
"Mistakes are the portals of discovery"
James Joyce