I am using strtotime to parse a date that is like 10:24 AM 22-Sep I was then parseing this thru checkdate
$pickup_time = strtotime($pickupTime);
if (!checkdate(date(n,$pickup_time) ,date(j,$pickup_time), date(Y,$pickup_time)));
{
echo json_encode(array("msg"=>"Nice one, that date doesn't exist. Try again.","status"=>"false"));
break;
}
But strtotime converts bad dates to the next logical date it would seem. So 31st Sep becomes 1 October. Completely voiding the checkdate function. Should you be able to use strtotime() to check for valid dates?
strtotime()doesn’t have built-in validation of dates, so if you need it – perform it manuallyps: it is wrong writing
date(n,$pickup_time). As long asnis a string – put it within quotes:date('n', $pickup_time)