I have a DATETIME for an entry in my database that is upcoming. I want to know the difference in time between the the DATETIME and the current date/time in Days, Hours, Minutes, and Seconds. I thought I might be able to use the date function to do this, but perhaps I am wrong.
This was my approach:
$now = mktime(0, 0, 0, date("m"), date("d"), date("y"));
$entry_datetime = strtotime($row['end_auction']);
$difference = date("G, i, s",($entry_datetime - $now));
echo $difference;
The result i received is
13, 20, 00
but that doesn't make any sense since the DATETIME in $row['end_auction'] is November 28th and today is November 19th, so much more than 13 hours apart.
How do I find the difference between the two values and how do I format it to appear as:
9 days, 10 hours, 32 minutes, and 20 seconds
Thank you in advance!