Have a look at the DS3232RTC library (note that is DS3232), it integrates with the Time library mentioned in reply #6 to synchronize the time with the RTC at 5 minute intervals (can be done more often). You should only need to change a line or two of code in setup, all the other time related functions remain unchanged.