How to code a RTC to run a code from 11:30pm to 5:30am?

We recommend that beginners work through the simple projects that come with the Arduino development software, to learn the language and special features of the Arduino. Blink an LED, read a button, a voltage, the temperature, etc.

If you don't, expect endless frustration with your rather advanced traffic light project.