function StartTime() {
var currentTime = new Date();
var hoursRemaining = 19 - currentTime.getHours();
var minutesRemaining = 60 - currentTime.getMinutes();
var secondsRemaining = 60 - currentTime.getSeconds();
timeLeft = " " +hoursRemaining+' '+minutesRemaining+' '+secondsRemaining+' ';
$("#countdown").html(timeLeft);
}
var countdown;
function StopTime() {
clearInterval(countdown);
}
setInterval(StartTime, 1000);
It's currently 8:30pm here and I want the countdown to restart at 9pm. It should reset every day at 9pm, even if it goes into negative numbers.