Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel 8 date difference in days

        $last_date = "2018-01-10 00:00:00";
        $current_date = Carbon::now()->toDateTimeString();

          //NUMBER DAYS BETWEEN TWO DATES CALCULATOR
          $start_date = CarbonCarbon::createFromFormat('Y-m-d H:i:s', $last_date);
          $end_date = CarbonCarbon::createFromFormat('Y-m-d H:i:s', $current_date);
          $different_days = $start_date->diffInDays($end_date);

 
PREVIOUS NEXT
Tagged: #laravel #date #difference #days
ADD COMMENT
Topic
Name
6+7 =