setTimeout(function(){ var d = new Date(); // current time var mins = d.getMinutes(); if(mins == '00') { migalka(); } }, 60000);