0
Date and Time Configuration Error
How will I add setInterval in date and time? And I want to check if hours is +24 https://code.sololearn.com/W1WBVWLq4t05/?ref=app
2 ответов
+ 3
function load() {
var date = new Date();
var day = date.getSeconds();
if (day == 20) {
alert("Congratulations, You've Received 10 Coins Of Your Daily Bonuses");
}else if (day > 10) {
console.log("hello"+day);
}
if( day > 25 )
clearInterval(timer); // clearing interval
}
var timer = setInterval(load, 1000); // setting interval
/* your condition day == day+1 never true
your logic is not understood
hours never be +24. It will be only between 0 to 23
I just adjusted your code to output something..
your else if has none outputs. so your output is empty and you are not calling function to use it.
I used getSeconds method .. run this code again after a few seconds if you don't output or wait a few seconds to see output.
*/
+ 2
Ok thanks