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

add 7 days to date php

$date = "Mar 03, 2011";
$date = strtotime($date);
$date = strtotime("+7 day", $date);
echo date('M d, Y', $date);
Comment

Add 2 days to the current date in PHP

<?php
  $result = date('d.m.Y', strtotime('+2 day', time()));

  echo $result;
?>
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

Add 7 days to the current date in PHP

<?php
  $result = date('d.m.Y', strtotime('+7 day', time()));

  echo $result;
?>
Comment

Add 5 days to the current date in PHP

<?php
  $result = date('d.m.Y', strtotime('+5 day', time()));

  echo $result;
?>
Comment

Add days to date in PHP

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

echo $date->format('Y-m-d');
Comment

PREVIOUS NEXT
Code Example
Php :: check if text exists in string php 
Php :: wordpress enqueue style child theme 
Php :: carbon diffForHumans 
Php :: laravel eloquent only today 
Php :: set nav link active on the basis of route laravel 
Php :: php timestamp to date 
Php :: add tags to custom post type 
Php :: php compare two dates 
Php :: error log array 
Php :: laravel clear all cache 
Php :: laravel request validate audio 
Php :: complete url php 
Php :: php loop through array 
Php :: php uppercase each word 
Php :: php not display notice 
Php :: import class route laravel 
Php :: laravel validate number to be at least 3 digits 
Php :: wp limit post revisions 
Php :: form post self php 
Php :: laravel-admin disable batch selection 
Php :: check if number is float in php 
Php :: create laravel project using laravel installer 
Php :: current timestamp carbon 
Php :: create new laravel project with specific version 
Php :: get soft deleted data laravel 
Php :: laravel mix disable notifications 
Php :: php date today plus 1 month 
Php :: PHPspreadsheet getColumnDimension 
Php :: magento2 memory limit 
Php :: get product price wordpress 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =