A little RTFM goes a long way. Open up the PHP manual (online if you were too stupid or lazy to download a free copy) and type "date difference" into the search box.
Work with DateTime and DateInterval objects.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012