There are quite a few different ways you can do this,
You will need to learn about the following functions:
mktime()
getdate()
strtotime()
Here is an example using strtotime:
function date_diff($date1, $date2) {
$s = strtotime($date2)-strtotime($date1);
$d = intval($s/86400);
$s -= $d*86400;
$h = intval($s/3600);
$s -= $h*3600;
$m = intval($s/60);
$s -= $m*60;
return array("d"=>$d,"h"=>$h,"m"=>$m,"s"=>$s);
}
$today="March 27, 2003 6:32:52 pm";
$newsdate="December 03, 2001 2:31:12 am";
$difference = date_diff($newsdate, $today);
echo "Time difference is: ". $difference['d'] ." days, "
. $difference['h']." hours, ". $difference['m']." minutes, and "
. $difference['s']." seconds";