1$created = new Carbon($survey->created_at);
2$now = Carbon::now();
3$difference = ($created->diff($now)->days < 1)
4 ? 'today'
5 : $created->diffForHumans($now);
1$dt = Carbon::create(2012, 1, 31, 0);
2$future = Carbon::create(2012, 1, 31, 0);
3
4$future = $future->addMonth();
5
6echo $dt->diffInDays($future); //31
1$to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34');
2$from = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2016-6-6 9:30:34');
3$diff_in_months = $to->diffInMonths($from);
4print_r($diff_in_months); // Output: 1
1Carbon::createFromDate(1991, 7, 19)->diff(Carbon::now())->format('%y years, %m months and %d days')
2// => "23 years, 6 months and 26 days"