📜  javascript 在自动计数器中获取时钟时间 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:10.954000             🧑  作者: Mango

代码示例1
function display_ct() {
var x = new Date()
var x1=x.getMonth() + 1+ "/" + x.getDate() + "/" + x.getYear(); 
x1 = x1 + " - " +  x.getHours( )+ ":" +  x.getMinutes() + ":" +  x.getSeconds();
document.getElementById('ct').innerHTML = x1;
display_c();
 }