Adding three months to a date in PHP

前端 未结 9 1114
我寻月下人不归
我寻月下人不归 2020-12-02 13:03

I have a variable called $effectiveDate containing the date 2012-03-26.

I am trying to add three months to this date and have been unsu

9条回答
  •  遥遥无期
    2020-12-02 13:38

    The following should work, but you may need to change the format:

    echo date('l F jS, Y (m-d-Y)', strtotime('+3 months', strtotime($DateToAdjust)));
    

提交回复
热议问题