adding days to a date in 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:
- codeigniter last insert id example
- check if a string has a certain character php
- create file in including if exists directory in php
- date(Y m d) php
- check is home page
- 8 digit random number generator in php
- $table- unique laravel
- $conn = new mysqli();
- __dir__ in php
- create DateTime from timestamp php
- eloquent pluck multiple columns
- Fehler beim Uploadtest der ausgewählten Datei.
- composer and php version
- get current date and time php
- Undefined index: gross_wt in C:\xampp\htdocs\aezaz\Dev\login\pdf_export\gb1.php on line 34
- How do I convert timestamp to epoch time in php
- create random password in php
- data seeder in laravel
- calling folder and out into folder in php
- Api to add condition for newrelic
- create laravel project with composer
- eloquent insert into select
- Difference in days of two dates in php
- explode a number php