Tuesday, 15 July 2014

node.js - Nodejs Repeat every system hour -



node.js - Nodejs Repeat every system hour -

i using moment (for current time) , waitjs (repeat) modules. if write codes below:

repeat(86400000, function() { //dashboard });

this function repeat every 1 hour. has counted since programme started. want work scheme time. example; when scheme time 1:00:00 (a.m.) function work. , continues every hour. how can this?

thanks!

using moment.js , waitjs this:

// wait until end of hr wait(moment().endof('hour') - moment(), function() { // start executing repeat function repeat(86400000, function() { //dashboard }); });

check out moment.js endof

node.js

No comments:

Post a Comment