Alex Rivera | Logout

PHP Calculating future date by adding days to a variable date

Asked 2010-04-22T16:30:59.193
10

I was looking at this post, and it is close to what I need: PHP - How to count 60 days from the add date

However, in that post, the calculation is performed by adding 60 days to the current date. What I need to do is calculate the date based on a variable date (and not the current date).

Something like this:

$my_date = $some_row_from_a_database;
$date_plus_10_days = ???;

Anyone know how to do that?

Thanks

Edit
Report

1 Answer

31

You can put something before the "+10 days" part:

strtotime("2010-01-01 +10 days");
answered 2010-04-22T16:32:34.983

Your Answer