I have a date in php formatted like this:
Fri May 01 2015 17:25:00 GMT +0100 (GMT Daylight Time)
And Im trying to compare it to a mysql DATETIME field:
$date1 = DateTime::createFromFormat("Y-m-d H:i:s e+", $start);
$sql = "SELECT * FROM ax_timestamps WHERE $date1 < datetimefeild ORDER BY id ASC";
But when it executes it returns 0 results even though based in the input and elements in the database it should pull results.
example of data in the datetimefeild feild:
2015-05-16 07:44:56
The date is being passed to php via ajax post from jQuery datepicker which is setup like this:
$("#datepicker").datepicker({ dateFormat: 'yy-mm-dd' });
var start = $.datepicker.parseDate("yy-mm-dd", $('#datepicker').val());