If this is only for one switch and you are interested I can write something up for you, however for multiple switches with different schedules, you may take a look at Schedy. It requires some initial setup but afterwards its easy to configure and has a lot of advanced functionality as well. I totally forgot about this app.