time = new Date(); time_th = time.getHours(); if (time_th >= 4 && time_th <= 18) { trace("a"); } else { trace("b"); }