Answers for "how to add day in date in php"

PHP
5

php date plus days

<?php 
// PHP program to add days to $Date 
  
// Declare a date 
$date = "2019-05-10"; 
  
// Add days to date and display it 
echo date('Y-m-d', strtotime($date. ' + 10 days')); 
  
?>
Posted by: Guest on June-04-2020
1

add 1 day php datetime

$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P1D'));
Posted by: Guest on November-04-2020
2

Add days to date in PHP

$date = new DateTime('2020-11-24');
$date->add(new DateInterval("P9D"));

echo $date->format('Y-m-d');
Posted by: Guest on January-14-2021

Browse Popular Code Answers by Language