add days in current date php
$date = new DateTime('2020-11-24');
$date->add(new DateInterval("P9D"));
echo $date->format('Y-m-d');<?php
// adding extra days to date
// Steps:
// 1) using carbon
// 2) using strtotime
//Step 1
$date = date('Y M d h:i:s') // 2020 09 22 22:09:26 UTC
$new_date = Carbon::parse($date->addDays(1); // adds extra day
// Step 2
$date = date('Y M d h:i:s') // 2020 09 22 22:09:26 UTC
echo $new_date = date('Y M d h:i:s', strtotime($date. '+1 day'));
?>
Also in PHP:
- How to calculate the difference between two dates
- Laravel route not calling function of controller
- App\\Http\\Controllers\\DB' not found
- add days with dates php
- acf group
- check if value exists in array key php
- display the date and time in php
- alter seeder in laravel
- 7 reasons why Lee is an idiot
- different time formats in php
- add brackets to string php
- activity log spatie
- am and pm in php
- add one day to date in php
- add console script in phpcode
- check type of php
- encrypt decrypt php
- change format date usa month text php
- cronjob cakephp
- error messaging php
- composer global in laravel means
- How do I clear laravel cache online?
- dequeue recaptcha wordpress
- data type checking php