The complete code is as follows:

</div> <script> var t = null; t = setTimeout(time, 1000); function time() { clearTimeout(t); dt = new Date(); var y = dt.getFullYear(); var mt = dt.getMonth() + 1; var day = dt.getDate(); var h = dt.getHours(); var m = dt.getMinutes(); var s = dt.getSeconds(); Document. QuerySelector (" showTime "). The innerHTML = "current time:" + mt + + y + "in" day "month" + + "-" + h + "" + m +" points "+ s +" seconds "; t = setTimeout(time, 1000); } </script>Copy the code

That’s all for the HTML display time and real-time refresh (detailed code).

If it helps you, thank you for your support!

If you are computer terminal, see the bottom right corner of the “one button three connections”, yes click it [ha ha]


Come on!

Work together!

Keafmd