Add days to current date from MySQL with PHP

后端 未结 4 1452
别那么骄傲
别那么骄傲 2021-01-18 11:59

I have a fixed date from MySql

startDate = 07/03/2011

I wanted to add 60 days on top this date to have an endDate.

$startDa         


        
4条回答
  •  余生分开走
    2021-01-18 12:58

    You could reformat the results of strtotime()

    $startDate = $result['startDate']; // 07/03/2011
    $endDate = date("m/d/Y", strtotime("$startDate +60 days"));
    

    Demo: http://codepad.org/9rWnoeQb

提交回复
热议问题