Js implements a countdown processing problem

implement a function:
the function is calculated in hours, such as the expiration time of the event is"20, 30, 30, 50 hours, and the current time examination is used to calculate the number of hours: minutes: seconds" from the arrival time to the target.

my preliminary code is:

setTime() {
    const currentTime = new Date();
    const arr = this.props.data.aimTime.split(":");  //:"20:30:45"
  
    const aimTime = 3600000 * (parseInt(arr[0])) + 60000 * (parseInt(arr[1])) + 1000 * (parseInt(arr[2]));   //
    const cuTime = (3600000 * currentTime.getHours()) + (60000 * currentTime.getMinutes()) + (1000 * currentTime.getSeconds());  //
    const remainTime = aimTime - cuTime;  //
    const hours = parseInt(arr[0]) - currentTime.getHours();  //
   
    const min = parseInt(arr[1]) > 0 ? (60 - currentTime.getMinutes() + parseInt(arr[1]))
      : 60 - currentTime.getMinutes();  //

    const second = parseInt(arr[2]) > 0 ? (60 - currentTime.getSeconds() + parseInt(arr[2]))
      : 60 - currentTime.getSeconds();   //

    
    remainTime > 0 &&
      this.setState({
        hours: hours > 9 ? hours : "0" + hours,
        min: min > 9 ? min : "0" + min,
        second: second > 9 ? second : "0" + second,
      });
  }

if the number of minutes and seconds is incorrect, how to correct it, or is there a better way to achieve this function

Mar.03,2021

function formatTime(t){
    t=t.toString();
    return t[1] ? t : '0'+t
}
function countDown(t){
    var maxTime=(new Date(t).getTime())-Date.now();
    if(maxTime>0){
        var h=parseInt(maxTime/(60*60*1000));
        var m=parseInt(maxTime/(60*1000)%60);
        var s=parseInt(maxTime/(1000)%60);
        var time=[h,m,s].map((el)=>formatTime(el)).join(':');
        console.log(time)
        setTimeout(countDown,1000,t);
    }else{
        console.log('timeout')
    }
}
countDown('2018-04-17 18:00:00');

there are many tools for time processing, such as moment.js , Datejs , date-fns , etc.

there is a relatively simple method

  http://www.jb51.net/article/9.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b647-2ba75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b647-2ba75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?