Var d = new date(); var d = new date(); An extension of the code is as follows: there are comments for small white people like me to watch

<! DOCTYPE html> <html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="Width = device - width, initial - scale = 1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <h1 id="countdown"></h1>
    <script>
        function countdown() {// calculate the number of days, hours, minutes, seconds from 2020-02-14 17:30:00. var start = new Date() var end = new Date("The 2020-02-14 17:30:00"// Offset = end - start; // Offset = end - start; Var days = math.floor (offset/(1000 * 60 * 60 * 24)) var days_change = offset % (1000 * 60 * 60 * 24) var hours = Math.floor(days_change / (60 * 60 * 1000)) var hours_change = days_change % (60 * 60 * 1000) var minutes = Math.floor(hours_change / (60 * 1000)) var minutes_change = Math.floor(hours_change % (60 * 1000)) var seconds = Math.floor(minutes_change / (1000)) var str = days +":" + hours + ":" + minutes + ":" + seconds

            var countdown_1 = document.getElementById("countdown");
            // countdown_1.innerHTML = days + ":" + hours + ":" + minutes + ":" + seconds
            countdown_1.innerHTML = str
        }

        countdown();

        setInterval(function() {// countdown()} once every second, 1000); </script> </body> </html>Copy the code