Answers for "php carbon format time hhHmm"

PHP
1

carbon two day ago

$dt  =Carbon::now();

echo $dt->subDay();                      // 2012-03-03 00:00:00
echo $dt->subDays(29);
Posted by: Guest on February-02-2021
1

add seconds to datetime carbon

Try to parse() it first:
$date = Carbon::parse($dateTime)
            ->addSeconds($seconds)
            ->format('Y-m-d H:i:s');
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language