I need help with refactoring a form. There's one issue left: I'd like to change a date input to dd.mm.yyyy format as the app is in German.
// $request->entry_date is '10.12.2017' (December 10th, 2017) $request->entry_date = Carbon::createFromFormat('d.m.Y', $request->entry_date); // In DDB after update: 2010-12-20 17:00:00 // Expected after update: 2017-12-10 (plus whatever time Carbon adds, I just care about the date) $client->update($request->all());
The 17:00 in the timestamp makes me suspect Carbon interprets the third and fourth digits of the year as hour, but I checked with the docs: Y is year (four digits), m is month (2 digits), d ist day (2 digits).
What's wrong with my code?