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

Hadoop MapReduce Spark Configuration Item

Scope of application The configuration items covered in this article are mainly for Hadoop 2.x and Spark 2.x. MapReduce Official documents https://hadoop.apache.org/doc…Lower left corner: mapred-default.xml Examples of configuration items name value description mapreduce.job.reduce.slowstart.completedmaps 0.05 Resource requests for Reduce Task will not be made until the percentage of Map Task completed reaches that value. mapreduce.output.fileoutputformat.compress false […]