HTML code for a clock

 <!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8">

    <title>HTML Clock</title>

    <style>

      body {

        font-family: Arial, sans-serif;

        text-align: center;

      }

      #clock {

        font-size: 48px;

        font-weight: bold;

        margin-top: 50px;

      }

    </style>

  </head>

  <body>

    <div id="clock"></div>

    <script>

      function updateTime() {

        var now = new Date();

        var hours = now.getHours();

        var minutes = now.getMinutes();

        var seconds = now.getSeconds();

        hours = hours < 10 ? "0" + hours : hours;

        minutes = minutes < 10 ? "0" + minutes : minutes;

        seconds = seconds < 10 ? "0" + seconds : seconds;

        document.getElementById("clock").innerHTML = hours + ":" + minutes + ":" + seconds;

      }

      setInterval(updateTime, 1000);

    </script>

  </body>

</html>