[SOLVED] Switch light on when motion detected but only after a certain time

Quick and dirty:

rule "limited light"
when
    Item motionSensor changed to ON
then
    if (now.getHourOfDay() >= 6 && now.getHourOfDay() < 23) {
        lightItem.sendCommand(ON)
    }
end

But I recommend that you have a look at: