Increase current date by 5 days

后端 未结 11 1974
执笔经年
执笔经年 2021-01-02 16:57
$date = date(\'Y-m-d\',current_time(\'timestamp\', 0));

How do I change $date to $date + 5 days?

PHP version is 5

11条回答
  •  [愿得一人]
    2021-01-02 17:28

    You can use

    strtotime(“+5 days”)
    

    to get the current date plus 5 days or

    $targetDate = date($date, strtotime(’+5 days’));
    

提交回复
热议问题