SOURCE

/**获取当前系统时间 */
function getSysDate(){
    var myDate = new Date();
    var y = myDate.getFullYear();
    var m = myDate.getMonth()+1;
    var d = myDate.getDate();
    var h = myDate.getHours();
    var f = myDate.getMinutes();

    var s = myDate.getSeconds();
    if(h<10){h = '0'+h;}
    if(f<10){f = '0'+f;}
    if(s<10){s = '0'+s;}

    return y+'-'+m+'-'+d+' '+h+':'+f+':'+s;
}

// getTime = getSysDate();
// document.write(getTime);


document.write("<div id='demo'>这里显示当前时间</div>");
var demo = document.getElementById('demo');

setInterval(function(){
    demo.innerHTML = getSysDate();
}, 1000);
console 命令行工具 X clear

                    
>
console