Checking if date in database is greater than current time
<p>I have a PHP script to check if the date stored in the database is greater, equal or less than the current time.</p>

<ul>
<li>If it is greater or equal, it echos 'greater'.</li>
<li>If it isn't greater, it echoes 'not'</li>
</ul>

<p>My issue is that even if the time in the database <strong>is not</strong> greater or equal to the current time, it echos 'greater' (when it's supposed to echo 'not').</p>

<p>Date stored in the database:</p>

<p><a href="https://i.stack.imgur.com/7Pomr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Pomr.png" alt="enter image description here"></a></p>

<pre><code>date_default_timezone_set('Europe/London');
$time_stamp = date('Y-m-d H:i:s');

$stmt = $con-&gt;prepare("SELECT * FROM table");
$stmt-&gt;execute();

$row = $stmt-&gt;fetch();
if($row['BannedUntil'] &lt;= $time_stamp) {
echo 'Greater';
}else{
echo 'not';
}
</code></pre>