<?php
// your first date coming from a mysql database (date fields)
$dateA = '2013-11-11 23:10:30';
// your second date coming from a mysql database (date fields)
$dateB = '2013-11-11 16:27:21';
$timediff = strtotime($dateA) - datetime();
if($timediff > 86400){
echo 'more than 24 hours';
}
else
{
echo 'less than 24 hours';
}
Fatal error: Uncaught Error: Call to undefined function datetime() in /in/nIkfq:7
Stack trace:
#0 {main}
thrown in /in/nIkfq on line 7
Process exited with code 255.