Step 1: use a counter to count seconds.
Step 2: once you can count seconds, count minutes
Finally step 3: Count hours.
use a variable for each counter. try writing the seconds program, and if you need help we'll help you. I'm going to write a clock program based on a 8 Mhz clock. I have it blinking a LED every 10 seconds based on a second counter variable. Eventually, I will add minutes and hours, but that is a low priority because I have changed my requirements for my current project that does not include a clock. When I add data logging capabilites, I'll add a clock.