Then, for example you could do, "Whatever was last accessed 3 minutes ago".
would be pretty cool
dunno how to do it though :S
any ideas?
Moderator: General Moderators
Code: Select all
function TimeDiffo($time)
{$uptime = time() - $time;
$d = floor($uptime / 86400);
$h = floor(($uptime % 86400) / (3600));
$m = floor((($uptime % 86400) % 3600) / 60);
$s = floor((($uptime % 86400) % 3600) % 60);
if ($d)
{return $d . "d $h" . 'h';}
elseif ($h and !$d)
{return $h . "h $m" . 'm';}
elseif ($m and !$h and !$d)
{return $m . "m $s" . 's';}
elseif ($s and !$m and !$h and !$d)
{return "$s" . 's';}}