Call the function, why is the time still motionless?

Code:
< script type= "text/javascript" >

        $(document).ready(function() {
            
            givetime();
        })
        
        var endtimes = new Array(); //
        var myDate;
        var time_end;
        function givetime() {
            var int_day, int_hour, int_minute, int_second;
            endtimes[0] = $("-sharpactivity_time1").val();
            endtimes[1] = $("-sharpactivity_time2").val();
            myDate = new Date().getTime(); //
            window.setTimeout("DownCount()", 1000);
        }

        function DownCount() {
            
            for(var i = 0; i < 2; iPP) {
                var time_distance;
                time_end = new Date(endtimes[i]).getTime();
                time_end = time_endPP;
                time_distance = time_end - myDate; // 
                if(time_distance <= 0) {
                    $("-sharpGroup_time"+i).html(":");
                    
                } else {
                    timechange(time_distance, i);
        
                }
            }
            window.setTimeout("DownCount()", 1000);
        }

        function timechange(time_distance, i) {
            
            int_day = Math.floor(time_distance / 86400000) //
            time_distance -= int_day * 86400000; //
            int_hour = Math.floor(time_distance / 3600000) //
            time_distance -= int_hour * 3600000; //
            int_minute = Math.floor(time_distance / 60000) //
            time_distance -= int_minute * 60000; //
            int_second = Math.floor(time_distance / 1000) //
            // 
            if(int_hour < 10){
                int_hour = "0" + int_hour;
            }
            if(int_minute < 10){
                int_minute = "0" + int_minute;
            }                
            if(int_second < 10){
                int_second = "0" + int_second;
            }                
            $("-sharpGroup_time" + i).html("<em></em>" + int_day + "" + int_hour + "" +int_minute + "" + int_second + "");
        }
    </script>

clipboard.png
time is always static, and the implementation effect is dynamic. The problem now is not to move

Mar.05,2021

time_end = new Date(endtimes[i]).getTime();
//
            time_end = time_endPP;
            //1;time_end+= 1000;
            

1 second plus milliseconds, definitely not moving.
see if this is the problem


$(document) .ready (function () {

            givetime();
        })
        
        var endtimes = new Array(); //
        function givetime() {
            endtimes[0] = $("-sharpactivity_time0").val();
            endtimes[1] = $("-sharpactivity_time1").val();
            
            window.setTimeout("DownCount()", 1000);
        }

        function DownCount() {
            
            for(var i = 0; i < 2; iPP) {
                var time_distance;
                var time_end = new Date(endtimes[i]).getTime();
                var myDate = new Date().getTime(); //
                time_distance = time_end - myDate; // 
                if(time_distance <= 0) {
                    $("-sharpactivity_time"+i+" a").removeClass("buy_button");
                    /*alert("-sharpactivity_time"+i+" a");*/
                    $("-sharpGroup_time"+i).html(":");
                } else {
                    timechange(time_distance, i);
                }
            }
            window.setTimeout("DownCount()", 1000);
        }

        function timechange(time_distance, i) {
            
            var int_day = Math.floor(time_distance / 86400000) //
            time_distance -= int_day * 86400000; //
            var int_hour = Math.floor(time_distance / 3600000) //
            time_distance -= int_hour * 3600000; //
            var int_minute = Math.floor(time_distance / 60000) //
            time_distance -= int_minute * 60000; //
            var int_second = Math.floor(time_distance / 1000) //
            // 
            if(int_hour < 10){
                int_hour = "0" + int_hour;
            }
            if(int_minute < 10){
                int_minute = "0" + int_minute;
            }                
            if(int_second < 10){
                int_second = "0" + int_second;
            }                
            $("-sharpGroup_time" + i).html("<em></em>" + int_day + "" + int_hour + "" +int_minute + "" + int_second + "");
        }

the reason is that var myDate = new Date (). GetTime (); / / get the current time
the position of the code
because you need to get the current time in real time to compare with the end time, calculate that if the time is always the same, the value will not change, because the end time is also the same, the fixed value

Menu