Datasheet

Whenever the RTC chip loses all power (including the backup battery) it will report the time
as 0:0:0 and it won't count seconds (its stopped). Whenever you set the time, this will
kickstart the clock ticking. So basically the upshot here is that you should never ever
remove the battery once you've set the time. You shouldn't have to and the battery holder is
very snug so unless the board is crushed, the battery wont 'fall out'
Setting the time
With the same sketch loaded, uncomment the line that starts with RTC.adjust like so:
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
This line is very cute, what it does is take the Date and Time according the computer you're
using (right when you compile the code) and uses that to program the RTC. If your computer
time is not set right you should fix that first. Then you must press the Upload button to
compile and then immediately upload. If you compile and then upload later, the clock will be
off by that amount of time.
Then open up the Serial monitor window to show that the time has been set
© Adafruit Industries https://learn.adafruit.com/adafruit-data-logger-shield Page 19 of 68