DS1307 Real-Time Clock
Easy. Here is one way to do it.


Read the clock off the rtc. 
Wait a known period of time, based on the mcu frequency, 
Read the clock off the rtc again. 
Compare the two time reading and it should have advanced. If not, fall back to compiled time.


There are other ways to do it as well, like bor, or square wave output, interrupt on vbat line, ......