There is a date in the format 'day.month.year' go 'dmY' coming to the server as a string. The date is passed as an address bar parameter.
In the controller, I need to bring it to the format 'Ymd H: i: s'
To do this, I use the following Carbon method: $ date = Carbon :: createFromFormat ('dmY', $ startDate) -> format ('Ymd H: i: s');
At the exit I get the date: $ date = "2017-05-01 17:40:26";
All would be nothing but initially in the formatted string, the time was not specified. Carbon has inserted it automatically. And the time seems to be inserted current.
I want the output of the method to be: $ date = "2017-05-01 00:00:00 "; in not "2017-05-01 17:40:26 ";
What you need to do what would be the time near the date was 00:00:00 .
...createFromFormat('dmY H:i:s', ...? - BookinCarbon::createFromTimestamp(strtotime($startDate))- Bookin$date = Carbon::createFromFormat('dmY', $startDate )->format('Ymd 00:00:00)');? - Gino Pane