title: PHP Check if 10 minutes has gone by
body: <p>I want to compare two <code>dates</code> with each other to see if 10 minutes has passed.</p>
  
  <p>This is the code that I've got but I can't quite figure out how to do it.</p>
  
  <p>I get the first date from my table (which is saved as a <code>timestamp</code>, example: 2017-03-26 22:33:45) and then I want to compare it with the <code>time</code> that is right <code>now</code>.</p>
  
  <pre><code>$sql = "SELECT saved_time from table1 where email = '$email'";
  $stmt = $conn-&gt;prepare($sql);
  $stmt-&gt;execute();
  while($row = $stmt-&gt;fetch()) {
      $savedTime = $row[0];
  }
  $now = time();
  if (/*10 minutes has passed between saved time and now*/) {
      echo "Your account is unlocked";
  } else if (/*10 minutes hasn't passed*/) {
      echo "Your account is locked";
  }
  </code></pre>