So my current $item['date'] function gets the time and date of the post in this format Y-m-d H:i:s
.
I want to display how many minutes was the post posted or if it is more than 24 hours, how many days ago was it posted OR like 0 days and 20 hours ago? something like that
Why doesn't the minus operator work here my code?
My current code:
<p><?php echo date('Y-m-d H:i:s') - $item['date'] ?> minutes ago</p>