Hej,
jag undrar om någon kan hjälpa mig att konvertera detta klock script till en 24 timmars klocka istället för en AM/PM klocka?
<SCRIPT language=JavaScript>
<!--
var timerID = null
var timerRunning = false
function stopTimeKeep(){
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
function startTimeKeep(){
stopTimeKeep()
showtime()
}
/* var now = new Date()
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
*/
var now = new Date();
<?php
print "var hours = ".date("H").";";
print "var minutes = ".date("i").";";
print "var seconds = ".date("s").";";
?>
function showtime()
{
seconds =(seconds+1) % 60;
if (seconds==0)
{
minutes =(minutes+1) % 60;
if (minutes==0) hours =(hours+1) % 24;
}
var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.jsclock.face.value = timeValue
timerID = setTimeout("showtime()",1000)
timerRunning = true
}
//-->
</SCRIPT>
/Stefan