PHP date_ago function!
Thursday, November 26th, 2009
Thought I posted this labourious piece of code that changes a unix timestamp into a “xx <seconds|minutes|hours|days|weeks|months> ago” date format.
<?php
function date_ago($time) {
if ($time < 60) {
$num = $time;
$unit = ’second’;
}
elseif ($time < 3600) {
$num = floor($time [...]