title: Compare two dates when subtract a days from one of them
body: <p>I'm trying for some time to compare two dates and return the result.
  And echo if the file is older than 2 days from now.
  Here is mine code:</p>
  
  <pre><code>$filename = './Sample.htm';
  $filedate = date('d/m/Y H:i:s', filemtime($filename));
  $date = new DateTime('-2 days');
  $noData = '';
  if ($filedate &gt; $date-&gt;format('d/m/Y H:i:s')) {
  $Data = "&lt;p&gt;The file is created in the last 2 days!&lt;/p&gt;";
  } else {
  $Data = "&lt;p&gt;The file is older than 2 days&lt;/p&gt;";
  }
  echo $Data;
  </code></pre>
  
  <p>The code works only if i compare in same month range. If the file is in another month it does not work. Any ideas?</p>