Using this circuit diagram can be made a simple light sensitive switch that enables connection allows automatic outdoor lighting after dark comes, and keep it a predefined period.
Since the opening of T4 and T5 LED light relay, and is powered lamp L1. Once one transistor is blocked, the lamp goes out.
T5's opening depends on the phototransistor T3. If light falls on it, it leads and deflects the current of T5 (T5 does not lead only when it is dark).
Period as remains lit lamp can be adjusted between 1 and 5 hours with P1.
Diodes D1-D5 rectifies the mains voltage and the result is filtered with C4. C5 condenser works as resistance, and so you have to have a minimum operating voltage of 400 V.