Here is another little helpful function that I put together in PHP. It displays how long ago a time stamp is from the current time in denominations of seconds, minutes, hours, days, weeks, etc.
function howLongAgo($datetime){ $diff = time() - strtotime($datetime); $units = Array( 'second' => 1, 'minute' => 60, 'hour' => 60 * 60, 'day' => 60 * 60 * 24, 'week' => 60 * 60 * 24 * 7, 'month' => 60 * 60 * 24 * 30, 'year' => 60 * 60 * 24 * 365 ); $units = array_reverse($units); foreach($units as $unit => $divisor){ if($diff > $divisor){ $p = (round($diff / $divisor) > 1) ? 's' : ''; return round($diff / $divisor).' '.$unit.$p.' ago'; } } return 'just now'; }