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

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

But you really should look at: