Had a need for this logic today – wrote up this snippet.
if(file_exists($filePath)) {
$lastEdit = filemtime($filePath);
$lastEditReadable = gmdate('r', $lastEdit);
$currentTime = time();
$currentTimeReadable = gmdate('r', $currentTime);
$ageOfFileInSeconds = $currentTime - $lastEdit;
$ageOfFileInMinutes = $ageOfFileInSeconds / 60;
if($ageOfFileInMinutes < 10)
{
// Do Thing
}
}