none
new code....... RRS feed

  • Question

  • hope u liked my previous code........

    this code helps u to display ur system time   

     

    <html>
    <script language="Javascript">
    setInterval("settime()", 1000);

    function settime () {
      var curtime = new Date();
      var curhour = curtime.getHours();
      var curmin = curtime.getMinutes();
      var cursec = curtime.getSeconds();
      var time = "";

      if(curhour == 0) curhour = 12;
      time = (curhour > 12 ? curhour - 12 : curhour) + ":" +
             (curmin < 10 ? "0" : "") + curmin + ":" +
             (cursec < 10 ? "0" : "") + cursec + " " +
             (curhour > 12 ? "PM" : "AM");

      document.date.clock.value = time;
    }
    </script>

    <body>

    <form name="date">
    <input type="text" name="clock" td align="left""value="">
    </form>

    </body>
    </html>

    Wednesday, March 14, 2007 3:49 AM

All replies