How Add Leading Zero of hours, minutes and seconds

var countDownDate = new Date("October 31, 2024 14:00:00").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);

Please Help me.

I have already tried this. Do I have a thought error?

function addZero(X){
if(X<10)
return "0"+X;
else
return X;
}