var d1 = new Date();
alert(d1);

解决方案 »

  1.   

    <input size=9 type=text name=clock style="border:solid 1px #FFFFFF">
    <script language="Javascript"><!--
    function timer()
    {
      now = new Date();
      h = (now.getHours()   > 9) ? now.getHours()   : "0" + now.getHours();
      m = (now.getMinutes() > 9) ? now.getMinutes() : "0" + now.getMinutes();
      s = (now.getSeconds() > 9) ? now.getSeconds() : "0" + now.getSeconds();
      clock.value =""+h+":"+m+":"+s+"";
      setTimeout( 'timer()',1000);
    } timer();
    // --></script>