📜  网站上的时间 - Html 代码示例

📅  最后修改于: 2022-03-11 14:53:20.638000             🧑  作者: Mango

代码示例2
function display_c(){
   var refresh=1000; // Refresh rate in milli seconds
   mytime=setTimeout('display_ct()',refresh)
}

function display_ct() {
  var CDate = new Date()
  var NewDate=CDate.toDateString(); 
  NewDate = NewDate + " - " + CDate.toLocaleTimeString();
  document.getElementById('ct').innerHTML = NewDate;
  display_c();
}