PHP Calculating future date by adding days to a variable date

前端 未结 6 1797
一整个雨季
一整个雨季 2020-12-10 05:40

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 addi

6条回答
  •  鱼传尺愫
    2020-12-10 06:22

    Use date_add

    http://www.php.net/manual/en/datetime.add.php

    $my_date = new DateTime($some_row_from_a_database);
    $date_plus_10_days = date_add($my_date, new DateInterval('P10D'));
    

提交回复
热议问题