$diff = Carbon::parse( $start_date )->diffInDays( $end_date );
$created = new Carbon($survey->created_at);
$now = Carbon::now();
$difference = ($created->diff($now)->days < 1)
? 'today'
: $created->diffForHumans($now);
<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use CarbonCarbon;
class DateController extends Controller
{
public function index()
{
$currentDateTime = Carbon::now();
$newDateTime = Carbon::now()->addDay();
print_r($currentDateTime);
print_r($newDateTime);
}
}
$startdate->diffInDays($todate); //total days between two dates
$startdate->diffInMinutes($todate); //total number of minutes between two dates
$startdate->diffInMonths($todate); //total number of months difference