I am very new in this php programming language. Can anybody will guide me how to add 1 month on a specific date on PHP. Please give any example or reference links. Please feel free for any suggestion.
Are you looking for the syntax of how to fetch ISO Date Format in PHP? By using this DateTime::setISODate() function you will be retrieve the ISO Date from the specific date. For details look below example of the ISO date function in PHP ...
<?php date_default_timezone_set('India/Kolkata'); $datetime = new DateTime(); // Offset from start of week 2 (7) = 5 $datetime->setISODate(2009, 2, 5); // Day 5 of week 2 of 2009 is the 9th of January. // Offset from start of week 2 (7) = 10 $datetime->setISODate(2009, 2, 10); // Day 10 of week 2 of 2009 is the 14th of January. ?>
You asking about how to adding one month in a specific date in PHP. This below example shows you how one month to a Date in PHP Date object.
Examples as below: ...
//PHP Example code to add one moth to a date
$todayDate = date("Y-m-d");// current date
echo "Today: ".$todayDate."
//Add one day to today $dateOneMonthAdded = strtotime(date("Y-m-d", strtotime($todayDate)) . "+1 month");
echo "After adding one month: ".date('l dS \o\f F Y', $dateOneMonthAdded)."