Topic: Time Stamp in the format "3 days ago" or "2 hours ago"
I find the above method much more useful and informative than 12.16.2008 15:35
I found the following code on php.net, can this be put to use somehow:
<?php
function ago($timestamp){
$difference = time() - $timestamp;
if($difference < 60)
return $difference." seconds ago";
else{
$difference = round($difference / 60);
if($difference < 60)
return $difference." minutes ago";
else{
$difference = round($difference / 60);
if($difference < 24)
return $difference." hours ago";
else{
$difference = round($difference / 24);
if($difference < 7)
return $difference." days ago";
else{
$difference = round($difference / 7);
return $difference." weeks ago";
}
}
}
}
}
?>