Do you understand how an RTC can be used in timing? Have you reviewed the Time library?
https://playground.arduino.cc/Code/Time