I had a problem where the RTC wasn’t maintaining time when the board was not powered on. I determined that the backup battery was not supplying power to the RTC. It turned out to be a dirty ground contact on the PCB for the battery. I was able to clean it using tissue, tweezers and alcohol.
Just thought I’d mention it because I suspect this is a common problem.