Call a function every hour
Posted
by
user2961971
on Stack Overflow
See other posts from Stack Overflow
or by user2961971
Published on 2013-11-07T21:51:03Z
Indexed on
2013/11/07
21:53 UTC
Read the original article
Hit count: 111
JavaScript
I am trying to update information from a weather service on my page. The info should be updated every hour on the hour. How exactly do I go about calling a function on the hour every hour?
I kind of had an idea but im not sure of how to actually refine it so it works... What I had in mind was something like creating an if statement, such as: (pseudo code)
//get the mins of the current time
var mins = datetime.mins();
if(mins == "00"){
function();
}
© Stack Overflow or respective owner