I am trying to determine the difference between the date of a file in a directory and the current date, I have tried calculating two ways:
$fileUnixTimeDate = filemtime($file);
$fileFormattedDate = date('m/d/y',filemtime($file));
$todayUnixTimeDate = time();
$todayFormattedDate = date('m/d/y',time());
$unixDifference = $todayUnixTimeDate - $fileUnixTimeDate;
$formattedDifference = $todayFormattedDate - $fileFormattedDate;
This is the result for two files in the directory: