var timeEventHours = 7;
function setTimeEvent() {
var date = new Date,
hours = date.getHours(),
minutes = date.getMinutes();
hours = timeEventHours - hours + 24 * (hours > timeEventHours);
setTimeout(timeEventHandler, 36E5 * hours - 6E4 * minutes);
};
function timeEventHandler() {
console.log('Hello world!');
setTimeEvent();
};
setTimeEvent();