I am trying to convert a javascript date object in php. I have tried to convert using my posted code, but it puts the time as 12:00:00. The date is being sent as 'Mon May 15 2017 15:08:03 GMT 0100 (GMT Standard Time)'. The idea is to insert into mysql in the format yyyy-mm-dd.
I would appreciate any help with this as it's driving me nuts. Many thanks.
UPDATE: I need the date & the time.
$intakedate = $_GET['date'];
$intakedateString = $intakedate;
$intakedateParts = explode(' ', $intakedateString, 5);
$intakedatenew = date('Y-m-d h:i:s', strtotime($intakedateParts[2] . ' ' . $intakedateParts[1] . ' ' . $intakedateParts[3]));