Answers for "carbon subtract day from date"

PHP
2

carbon subdays

//Laravel example

$users = Users::where('status_id', 'active')
           ->where( 'created_at', '>', Carbon::now()->subDays(30))
           ->get();
Posted by: Guest on November-08-2021
0

minus day from carbon date

$day = '2019-10-30 18:29:19';
$date = Carbon::createFromFormat('Y-m-d H:i:s', $day);
$date->subDay(); // Subtracts 1 day
echo $date->format('Y-m-d h:i:s');
Posted by: Guest on July-05-2021

Code answers related to "carbon subtract day from date"

Browse Popular Code Answers by Language