Check out how the DS3231 Alarm functions work. They will interrupt even a delay() statement. At the appointed time the specified function is called.
SeeThis same question was answered here:
For another way to see how to set this up, let me refer you to this article:
Build Programmable Time-based Switches Using a Real Time Clock
The code can be downloaded Here