How to compare current time with old time in PHP <p>I have stored date field at DB.</p> <p>In PHP, i am getting that field and converted into date. </p> <p>I want to compare that time with current time. If that difference is above 60 minutes. It will return some value.</p> <p>I dont know how to write logic for that</p> <pre><code>$lastUpdatedField = $rows_fetch['lastUpdatedTime']; $lastUpdatedDate = new DateTime($lastUpdatedField); $nowDate = new DateTime(date('y-m-d h:m:s')); </code></pre> <p>I have old date&amp;time is in $lastUpdatedDate variable, and current time is in $nowDate.</p> <p>How to compare these two</p>