Yeah, you could make it a function and have the function call at the top of each page. Thats fine.
Time is easiest (in my opinion) if you work with timestamps. A timestamp is the number of seconds since 1970.
So if the timestamp now is 1083793879, then the timestamp a minute ago might be 1083793879-60, and in a minutes time it'll be 1083793879+60. Using the mktime() function you can calculate the time for any second since 1970. If you want to know the time in 2 hours you just call:
mktime()+(26060);
2hours 60minutes 60seconds.
If you want 3 weeks from now:
mktime()+(86400 7 3);
86400(seconds in a day) 7 days 3 weeks.
To work out the timestamp for my birthday:
mktime(0,0,0,3,28,1977);
To work out how old I am in weeks:
(mktime() - mktime(0,0,0,3,28,1977))/(606024*7);
1414.4 weeks old. Crumbs. I'm ancient.
:p