Мир «Детей Пространства»
clock.js at tip
00000
00000
00:00:00
Not logged in

File www-scripts/clock.js from the latest check-in


function checkTime(i,filler) {
	if (i <10) {
		return filler+i.toString();
	} else {
		return i.toString();
	}
}	

function tickClock() {
	d=new Date()
	space=d.getTime().toString()

	document.getElementById("clock-mega").innerHTML=space.slice(0,4);
	document.getElementById("clock-lakh").innerHTML=space.slice(4,5);
	document.getElementById("clock-hundred").innerHTML=space.slice(5,8);
	document.getElementById("clock-sec").innerHTML=space.slice(8,10);
	document.getElementById("clock-min").innerHTML=checkTime(d.getHours(),' ')+":"+checkTime(d.getMinutes(),'0')+":";
	document.getElementById("clock-earthsec").innerHTML=checkTime(d.getSeconds(),'0');
	var t = setTimeout(function(){tickClock()},500);
}