Answers for "carbon convert date to datetime"

PHP
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
0

carbon add few hours

Carbon::now('UTC')->addHour($hours)->format('Y-m-d H:i:s')
Posted by: Guest on November-10-2020

Code answers related to "carbon convert date to datetime"

Browse Popular Code Answers by Language