split ur problem into 3 parts , display a string in lcd , write driver for rtc , and other time setting routines.
u need to know about i2c protocol for communicating with 1307 , search the net . i have done this , but the code is not with me right now. try it and feel free to ask.
Check this application note from Maxim **broken link removed** . The sample code is in assembly but you can convert it in C in no time or you can even use in-line assembly feature of your C compiler and directly include this code into your C project.