window.setInterval(function(){ // Set interval for checking
var date = new Date(); // Create a Date object to find out what time it is
if(date.getHours() === 8 && date.getMinutes() === 0){ // Check the time
// Do stuff
}
}, 60000); // Repeat every 60000 milliseconds (1 minute)
setInterval(()=>{
let now = new Date();
//86400000 represents 10 hours in milliseconds Change it as you like
if(now.getTime() == 86400000 ){
//your code
}
}, 1);