Library for ds1302

Good evening, I’m a guy who has extra time studying arduino, and I’m trying to create a small hydroponics project, which will have to be managed independently by arduino (given the many devices to connect I have chosen an arduino mega).
among other things I inserted the ds1302 module to have the time available to program the start of lights and pumps and I’m trying to use this library here GitHub - Makuna/Rtc: Arduino Library for RTC, Ds1302, Ds1307, Ds3231, & Ds3234 with deep support. Please refer to the Wiki for more details. Please use the gitter channel to ask questions as the GitHub Issues feature is used for bug tracking. and to understand how the library I’m working on this example Rtc/DS1302_Simple.ino at master · Makuna/Rtc · GitHub, but the result on the serial is the following

compiled: Mar 3 202115: 48: 34
03/03/2021 15:48:34
RTC lost confidence in the DateTime!
RTC is newer than compile time. (this is expected)
00/00/2000 00:00:00
RTC lost confidence in the DateTime!
00/00/2000 00:00:00

and it always repeats the same, could you help me understand the operation of the commands of this library, so that I can implement it and insert it in my project?
I thank you for the help you will give me if you want

Looks weird. What the sketch is trying to do is read the compile time through the __DATE__ and __TIME__ macros, then set the RTC’s time to that time, then read it out again (and since the RTC time is ticking it should advance beyond the compile time). So this part

Is okay when running using the module for the very first time and no date is set yet.


is also good since it seems to have read an RTC time that is newer than the compile time, indicating that the clock is ticking.

But then…

Again shows that the RTC has lost its time.

What exact DS1302 module do you use? Does it have a good, new battery? How exactly have you connected the module to the Mega?