var now = (new Date).getHours(), start = 17, end = 9; if (now > end && now < start) { alert("Попап не нужен"); } else { alert("Попап");}