'time' is very advanced~complex code work, especially if you want to do the 'full system' (real world time and date: years, months, days, weeks, seasons, seconds, minutes, hours, civilian time vs miltary time, time of day: dawn morning noon afternoon dusk evening night, daytime vs night-time, and etc). Unless you're a good coder, I'd use Pixie's Clock Library.
there's also these links too (my feeble attempt at 'time' coding, lol):
viewtopic.php?f=18&t=4317viewtopic.php?f=18&t=4162ask if you got any questions or need any help.