RTC timer ZS -042 how does it work

I bought a ZS -042 timer for arduino, I got it worked and had the display show up date and time with seconds counting. I actually wanted to use a particular time to make a pin HIGH and again LOW at a particular time. I read in the post to disconnect the resistor charging the CMOS, I did that as well.

When the arduino power is put off and switched ON, the timer clock begins from the set time in the sketch, though I have the timer and CMOS to back up why is the program running from the sketch. So I want to know, how exactly does this timer circuit work. What is the point of the RTC if it cannot keep back-up of time and date.

Pls help me understand the working of RTC and find my sketch and help me with solution.

Thank you.

RTC timer.txt (1.12 KB)

Provide a link to that ZS-042 RTC hardware and post a wiring diagram of your setup!

Did you read that comment:

  // The following lines can be uncommented to set the date and time
  rtc.setDOW(MONDAY);     // Set Day-of-Week to SUNDAY
  rtc.setTime(13, 22, 0);     // Set the time to 12:00:00 (24hr format)
  rtc.setDate(27, 8, 2018);   // Set the date to January 1st, 2014

These lines should be uncommented only if you want to set the time. Once you set it you should comment it out again so the time don't get set at every power up. If your RTC has a battery backup it should keep the time over power cycles.