Boredom

Time:2019-8-23

Don’t say much, just go to the code.

<html>

<head>
    < title > countdown </title >
</head>

<body>
    <div id="time1"></div>
    <p>-----------------------</p>   
    <div id="time2"></div>
</body>

<script></script>
<script type="text/javascript">
    window.onload = function () {
        endTime();
    }

    function endTime() {
        var myDate = new Date();

        var timestamp = Date.parse(myDate) / 1000;

        var date = myDate.getDate();
        var year = myDate.getFullYear();
        var month = myDate.getMonth() + 1;

        var endtime1 = year + '-' + month + '-' + date + ' 12:00:00';
        var endtime2 = year + '-' + month + '-' + date + ' 18:00:00';

        var time1 = Date.parse(new Date(endtime1)) / 1000;
        var time2 = Date.parse(new Date(endtime2)) / 1000;
        if(time1 > timestamp) {
            $('#time1').text(time1 - timestamp +'S');
        }

        if(time2 > timestamp) {
            $('#time2').text(time2 - timestamp +'S');
        }

        setTimeout("endTime()", 1000);
    }
</script>

</html>

Recommended Today

Promising, hypertextview (v3.2.1)

Hi, developer, to see the newSuperTextViewNow! 💡 all of the above demonstrations were conducted bySuperTextViewStrong drive support. SuperTextViewThe difference is that it’s just a simple control element, but not just a control. It is flexible and changeable, with powerful embedded logic, providing you with rich and colorful but extremely simple development support. SuperTextViewSave you from […]