I'm trying to convert a date and time variable into date only in a different format:
$test_date = '01/07/2018 10:00-12:00';
$result = substr($test_date, 0, 10);
$newDate = date("Ymd", strtotime($result));
echo $newDate;
Expected result= 20180701 Actual result= 20180107
Tried all the relative variations I can find on here but keep getting 'Ydm' instead of 'Ymd'.
I'm I missing something obvious here?