Carbon date necessary feature
Today I will show some common necessary features of carbon. Which is inherited from the PHP DateTime class.
$dt = Carbon::now();
$dtToronto = Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Toronto');
$dt = Carbon::parse('2012-10-5 23:26:11.123789');
$dt->addDays(29);
$dt->addDay();
$dt->subDay();
$dt->subDays(29);
format('Y-m-d H:i'))
$dt->formate('Y-m-d H:i')); // 2015-12-27 00:0
$dt->toDateString(); // 1975-12-25
$dt->toFormattedDateString(); // Dec 25, 1975
$dt->toTimeString(); // 14:15:16
$dt->toDateTimeString(); // 1975-12-25 14:15:16
$dt->toDayDateTimeString(); // Thu, Dec 25, 1975 2:15 PM