Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php add days to date

<?php  
   
$date = "2022-08-12"; 
  
// Add days to date and display it 
echo date('Y-m-d', strtotime($date. ' +10 days'));  // 2022-08-22
echo date('Y-m-d', strtotime(date('Y-m-d'). ' +1 days')); 	// 2022-08-23
echo date('Y-m-d', strtotime(date('Y-m-d'). ' +1 months')); // 2022-09-12
echo date('Y-m-d', strtotime(date('Y-m-d'). ' +1 year'));	// 2023-08-12
  
?> 
Comment

php add days to date

$start_date = "2015/03/02";  
$date = strtotime($start_date);
$date = strtotime("+7 day", $date);
echo date('Y/m/d', $date);
Comment

how to add extra days from a date php

<?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'));
?>
Comment

php add one day to date

// add 1 day to the date above
$n = date('Y-m-d', strtotime( $d . " +1 days"));
Comment

add 1 day php datetime

$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P1D'));
Comment

PHP Date add days

$date = date('Y-m-d', strtotime("+1 day"));
Comment

adding days in datetime php

<?php
$date = new DateTime('2016-06-06'); // Y-m-d
$date->add(new DateInterval('P30D'));
echo $date->format('Y-m-d') . "
";
?>
Comment

PREVIOUS NEXT
Code Example
Php :: codeigniter table list 
Php :: delete after 30 days in php 
Php :: laravel select default old value 
Php :: validate each value from array laravel 
Php :: get last letter in php 
Php :: use latest with first in laravel eloquent 
Php :: how to display the taxonomy image in wordpress 
Php :: hmtl remove tag php 
Php :: woo set_stock_quantity 
Php :: faker laravel 
Php :: require in php 
Php :: clear array php 
Php :: laravel subtract date 
Php :: php sort array of array by key 
Php :: header refresh page php 
Php :: woocommerce profile photo upload 
Php :: Composer Fatal error: Call to undefined function SymfonyPolyfillMbstringiconv() in phar 
Php :: get ip country 
Php :: delete all records from table using button laravel Eloquent 
Php :: php get keys and values from array 
Php :: add class to body class wordpress 
Php :: get month from database php 
Php :: php append element to array 
Php :: wc php get product permalink 
Php :: crul in laravel 
Php :: pluck array in laravel 
Php :: string to boolean php 
Php :: insert data in database using seeder in laravel 
Php :: for loop in laravel 
Php :: send multiple mail in laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =