Have a look at this
following function at a member ( NogDog ) website.
Maybe you can use it, or modify it to suit your application.
Regards 🙂
halojoy
<?php
/* weblink:
http://www.charles-reace.com/PHP_and_MySQL/Time_Difference/
*/
/**
* array timeDiff(int $t1, int $t2)
* $t1 and $t2 must be UNIX timestamp integers, order does not matter
* returns array broken down into years/months/weeks/etc.
*/
function timeDiff($t1, $t2)
{
if($t1 > $t2)
{
$time1 = $t2;
$time2 = $t1;
}
// .............................................
?>