Я пытаюсь преобразовать строку в дату, но, видимо, указанный мной формат не принят date_create_from_format
, я сделал:
$search_date = trim('09/26/2019 - 09/27/2019');
$search_date = explode('-', $search_date);
echo $search_date[0];
$date_start = date_create_from_format('m/d/Y', $search_date[0]);
var_dump($date_start);
это возвращение:
09/26/2019 bool(false)
<br />
<b>Fatal error</b>: Uncaught Error: Call to a member function getTimestamp() on bool in [...][...]:13
Stack trace:
#0 {main}
thrown in <b>[...][...]</b> on line <b>13</b><br />
глядя на документацию Я вижу в формате:
>d and j Day of the month, 2 digits with or without leading zeros
>m and n Numeric representation of a month, with or without leading zeros
>Y A full numeric representation of a year, 4 digits
и моя дата на самом деле: 09/26/2019
, что я пропускаю?