Form Date String:
YYYY-MM-DD
has no time associated with it. The MySQL timestamp is:
YYYY-MM-DD HH:mm:ss
to compare the two, you will need to add time to the date string, for example, at midnight, for example
$datetime = '2008-08-21'.' 00:00:00';
and then use the function to compare the time between them
if (strtotime($datetime) > strtotime($timestamp)) { echo 'Datetime later'; } else { echo 'Timestamp equal or greater'; }
Jake mcgraw
source share