<html> <script> function clock () { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds() var TheTime = "" + ((hours > 12) ? hours -12 :hours) if (TheTime == "0") TheTime = 12; TheTime += ((minutes < 10) ? ":0" : ":") + minutes TheTime Value += ((seconds < 10) ? ":0" : ":") + seconds TheTime += (hours >= 12) ? " P.M." : " A.M." myClock.innerHTML = TheTime ; </script> <BODY onLoad="setInterval('clock()',1000);"></body> </html> |