1 var timer=null; 2 3 function tt(n){ 4 if(n<10){ 5 return '0'+n 6 }else{ 7 return n+'' 8 } 9 10 } 11 12 timer=setInterval(function(){ 13 //var oSys = document.getElementById('systime'); 14 var oDate=new Date(); 15 var oY=oDate.getFullYear(); 16 var oM=oDate.getMonth(); 17 var oD=oDate.getDate(); 18 19 var oH=oDate.getHours(); 20 var oMinutes=oDate.getMinutes(); 21 var oS=oDate.getSeconds(); 22 23 $("#systime").text(tt(oY)+'.'+toDou(oM+1)+'.'+tt(oD)+' '+tt(oH)+':'+tt(oMinutes)+':'+tt(oS)) 24 },1000)