RTC changing time on power loss

I'm having some issues with the Adafruit data logging shield with the PCF8523 RTC - Overview | Adafruit Data Logger Shield | Adafruit Learning System

Basically on occasion when I pull and then plug the power back in to my Arduino the RTC changes time, quite often to a time which doesn't exist or is in the future (ie: 01/01/2137 - 31:27:30, yes that's 31 hours).

The code I have uploaded doesn't seem to have an effect (tried it with a standard RTClib example and it still happened). I've also tried it with two separate data loggers and Arduinos...

Any help would be much appreciated.

Weak back up battery? Maybe place a 10 or 15 uF capacitor across the module Vcc & ground along with a diode between the module and Vcc.

jm0802:
I've also tried it with two separate data loggers

What do you mean? Two different shields, two different sketches? What?

aarg:
What do you mean? Two different shields, two different sketches? What?

I have two of the same setup. An Arduino, the data logging shield and some sensors. Both setups have the same issue.

Even with different sketches uploaded the problem still seems to occur.

Due_unto:
Weak back up battery? Maybe place a 10 or 15 uF capacitor across the module Vcc & ground along with a diode between the module and Vcc.

The batteries are brand new. I'm going to try a capacitor next though.

Adafruit's a good company. If the shield design needed a 10-15uf cap to function correctly, don't 'ya think they would have installed it for you?

All I know is you have two identical systems using Adafruit RTC shields...

My crystal ball is broken today. You'll need to help me/us understand what bits and pieces you have and how they're connected. It goes like this...

Which Arduino? Uno? Have you measured the actual VCC voltage?

How are you powering the board? USB? VIN pin? Barrel jack? At what voltage?

What sensors? How are they powered? How far from the board are they?

Notice how the questions have a common theme? Yep, you guessed it. Bad power. Noisy or too low a voltage. But that's just a guess because that's all I can do with the information you've provided, so far.