PHP – add + 7 days to date format mm dd, YYYY

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

<?php
// Prints the day
echo date(“l”) . “<br>”;

// Prints the day, date, month, year, time, AM or PM
echo date(“l jS \of F Y h:i:s A”) . “<br>”;

// Prints October 3, 1975 was on a Friday
echo “Oct 3,1975 was on a “.date(“l”, mktime(0,0,0,10,3,1975)) . “<br>”;

// Use a constant in the format parameter
echo date(DATE_RFC822) . “<br>”;

// prints something like: 1975-10-03T00:00:00+00:00
echo date(DATE_ATOM,mktime(0,0,0,10,3,1975));
?>

 

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *

PAGE TOP
error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email