setInterval(()=>{ let now = new Date(); //86400000 represents 10 hours in milliseconds Change it as you like if(now.getTime() == 86400000 ){ //your code } }, 1);