SOURCE

function countTime(time){
    var nowDate = +new Date();
    var inputDate = +new Date(time);
    var times = (inputDate - nowDate) / 1000;

    var d = parseInt(times/60/60/24);
    var h = parseInt(times/60/60 % 24);
    var m = parseInt(times/60 % 60);
    var s =  parseInt(times % 60);

    var countDown = d.toString().fontcolor('red') + 'days' + h + 'hours' + m + 'mins' +s + 'secs';
    console.log(countDown)
}

countTime('2022-06-26 18:00:00')
console 命令行工具 X clear

                    
>
console