How do I get next month date from today's date and insert it in my database?

后端 未结 13 809
我寻月下人不归
我寻月下人不归 2021-02-01 15:07

I have two columns in my db: start_date and end_date, which are both DATE types. My code is updating the dates as follows:



        
13条回答
  •  不要未来只要你来
    2021-02-01 15:18

    You can use strtotime() as in Gazler's example, which is great for this case.

    If you need more complicated control use mktime().

    $end_date = mktime(date("H"), date("i"), date("s"), date("n") + 1, date("j"), date("Y"));
    

提交回复
热议问题