I am using this:

$dateBetween = date("z",time()) - date("z",$inputTime);

Although I know there will be the problem at the end of a year (1st date will be smaller than the 2nd one).
So how could we get around in this situation?

Great thanks,