This is one of those things that seems like it should be simple, but very few examples are given that are straight forward and easy to follow. There are lots of examples of 30 days ahead of the current date/time, but here is a simple example of getting that data from a database and then calculating the date ahead.
$date = The value of the database from your query
$daysahead = The number of days ahead you want to calulate
$final_date = date(“m/d/Y”, strtotime($date) + (86400 * $daysahead));echo $final_date;
Explanation:
The date object gets your desired format passed as the first variable, then we invoke strtotime with the database value for the date we are starting with, then add the number of seconds in a day times the number of days ahead you are looking for. This would also work of course for previous days by changing the “+” to a “-”
Hope this helps someone.