Store timestamp with time 00:00:00
For safety just let Carbon decide the end or the start of the day using ->endOfDay()
or ->startOfDay()
. Choose what suits you more.
Carbon::createFromFormat('d-m-Y', $date_interval["start_date"])->endOfDay();
Carbon::createFromFormat('d-m-Y', $date_interval["start_date"])->startOfDay();
I've usually set the date with the call, and then reset the time to 00:00 with
Carbon::setTime(0, 0, 0); // from the parent, DateTime class
In the class, there is also a Carbon::startOfDay() method that will set the appropriate values.
public function startOfDay()
{
return $this->hour(0)->minute(0)->second(0);
}