动态显示时间

<html>
  <head>
    <title>动态显示时间</title>
    <style type = "text/css">

    </style>
  </head>
  <body>
    <div id='times'>
    </div>
      <script type='text/javascript'>
        function getD1()
       {
	  var date =new Date();
	  var d1 =date.toLocaleString();
	  var div1=document.getElementById("times");
	  div1.innerHTML = d1;
      }
      setInterval("getD1();",1000);
    </script>
  </body>
</html>
原文地址:https://www.cnblogs.com/liang-xp/p/14860738.html