some rtc's power on reset to a set value eg ds1307 power on default is 01/01/00 01 .
you can look for this value when your pic powers up and if its something else then assume the time is still set and leave it as it is.
extract from the ds1307 data sheet
On first application of power to the device the time and date registers are typically reset to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS). The CH bit in the seconds register will be set to a 1.
Bookmarks