Code: Alles auswählen
<div style="text-align: center;">
<span id="c1" style="font: bold 25px arial; color: #CD6600;"></span><br>
<span id="c2" style="font: bold 20px arial; color: #CD6600;">;</span><br>
<small>...seit dem Wintereinbruch</small>
</div>
<script type='text/javascript'>
// Bitte ein bereits vergangenes Datum eintragen!
var begin = new Date('November 26, 2010 08:00:00');
function toSt2(n) {
var s = '';
if (n < 10) s += '0';
return (s + n).toString();
}
function toSt3(n) {
var s = '';
if (n < 10) s += '00';
else if (n < 100) s += '0';
return (s + n).toString();
}
function countup() {
var d = new Date();
var count = Math.floor(d.getTime() - begin.getTime());
var miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
var seconds = toSt2(count%60); count = Math.floor(count/60);
var minutes = toSt2(count%60); count = Math.floor(count/60);
var hours = toSt2(count%24); count = Math.floor(count/24);
var days = count;
document.getElementById('c1').innerHTML = days + ' TAGE';
document.getElementById('c2').innerHTML = hours + ':' + minutes + ':' + seconds
setTimeout('countup()', 50);
}
countup();
</script>