I want to store a timestamp in the database with time component as 00:00:00.
The following code:
$start_date = Carbon::createFromFormat('d-m-Y', $date_interval["start_date"]);
$end_date = Carbon::createFromFormat('d-m-Y', $date_interval["end_date"]);
adds the current time to the date, when I provide a date only without time specification.
I need this because I need to retrieve the internal integer from the database afterwards which should be the start of the day.
What is the best way to store this 'start of day'?
0or an empty datetime like0000-00-00 00:00:00?yyyy-mm-dd 00:00:00.Carbon::createFromFormat('d-m-Y 00:00:00', ..);;pstartOfDay()method that you can use to reset the date objects time to00:00:00, once again in docs Ctrl-F with help you find it.