TIME SYNC WITH DS1307 RTC

Are you using time.h? if so did you set a syncprovider?