I looked around for a 24hr JS time script and found the following from http://www.crays.com/jsc/jsC4Udate.htm: Time in 24-hr format <SCRIPT Language="JavaScript"> <!-- hide from old browsers var curDateTime = new Date() var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curSec = curDateTime.getSeconds() var curTime = ((curHour < 10) ? "0" : "") + curHour + ":" + ((curMin < 10) ? "0" : "") + curMin + ":" + ((curSec < 10) ? "0" : "") + curSec document.write(curTime) //--> </SCRIPT> Code (markup): After testing it, I realised at 12pm the time goes to "00:00:00" instead of staying at 12. At 12am the time goes to "00:00:00" which is fine. How can I fix this or is there a better written script around?
Another questions is how to code the following; If the time is between 7pm and 7am do thiselse If the time is between 7am and 7pm do this