Problem: The output is wrong despite that in DB is correct (timestamp)
Screenshot of DB: http://prntscr.com/mjftzn
The code is the output
$dbDate = strtotime(date('Y-m-d H:i:s')); // Database date
$endDate = strtotime("".$query['duedate'].""); // current time
$diff = $endDate - $dbDate; /// diffrence
$days = intval(intval($diff) / (3600*24));
$newDays = $days < 0 ? 'EXPIRED' : $days;
Result of code: http://prntscr.com/mjfw4t
Expected: 14 day remaining instead of expired, if -1 it will show expired