var startTime = (new Date()).setHours(8,30), finishTime = (new Date()).setHours(20,30), currentTime = new Date(); if (currentTime >= startTime && currentTime <= finishTime) { alert('Рабочее время'); }