This is intended to be an easy to understand piece of arduino code, that will, with minimal hardware, get you started on any project where you might need to time on and off lights or any other appliance.
To work this code only needs:
An Arduino (almost any would do, tested on Mega, Uno, Yun, Nano, Micro, and a bare 328P atmel)
A 4 channel relay board (you could easily modify code to use 1 to 8 or any number of channels)
An RTC (I prefer and suggest I2C DS1307, but with little changes any would do)
Optional- 20 x 4 I2C LCD, but you could easily do without, as it is just for visual feedback
I uploaded the required libraries, for easier use. Libraries Credits goes to their creators.