Home Tutorial Php Phpdate PHP Date add 1 day

 
 

Share on Google+Share on Google+
PHP Date add 1 day
Posted on: August 24, 2009 at 12:00 AM
Advertisement
In this example we will show you how you can add 1 day to a date.

PHP Date add 1 day

This simple code will tell you how you can easily add 1 day to a date. 

Example code for PHP Date add 1 day:

<?php
$todayDate = date("Y-m-d");// current date

echo "Today: ".$todayDate."<br>";

//Add one day to today
$date = strtotime(date("Y-m-d", strtotime($todayDate)) . " +1 day");
echo "After adding one day: ".date('l dS \o\f F Y', $date)."<br>";


?>


Here is the output of the program:

Today: 2009-08-24
After adding one day: Tuesday 25th of August 2009

 

Advertisement

Related Tags for PHP Date add 1 day:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 24, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com