[TYPO3-UG Spain] [Re]: Reloj

Nicolas Puente nicolas.puente at lgb-rlp.de
Fri Nov 7 09:46:31 CET 2008


fabiola:
Aquí tienes un relog digital y funciona.
Saludos

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<title>Time</title>
<script type="text/javascript">
<!--
function start() {
    time();
    window.setInterval("time()", 1000);
}

function time() {
    var now = new Date();
    hours = now.getHours();
    minutes = now.getMinutes();
    seconds = now.getSeconds();

    thetime = (hours < 10) ? "0" + hours + ":" : hours + ":";
    thetime += (minutes < 10) ? "0" + minutes + ":" : minutes + ":";
    thetime += (seconds < 10) ? "0" + seconds : seconds;

    element = document.getElementById("time");
    element.innerHTML = thetime;
}

//-->
</script>
</head>
<body onload="start();">
 <span id="time"></span>
</body>
</html>


More information about the TYPO3-UG-spain mailing list