I have the last update time but i would like to compare it to the current time and subtract it and get an answer in seconds.
Basically being able to see how long ago it was refreshed.

$refresh = filemtime("stats.php");
$update = date("m/j/y h:i", $refresh);

echo "Last refreshed: ".$update. "<br/>";
echo"<a href='' onclick='history.go(0)'>Refresh Server Status</a>";
$refresh = filemtime("stats.php");
$now = time();
$last_update = strtotime(date("m/j/y h:i", $refresh));
$answer = $now - $last_update;

echo "Last refreshed: ".$last_update. "<br/>";
echo"<a href='' onclick='history.go(0)'>Refresh Server Status</a>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.