Increase current date by 5 days

后端 未结 11 1917
执笔经年
执笔经年 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:22

    For specific date:

    $date = '2011-11-01';
    $date_plus = date('Y-m-d', strtotime($date.'+5 days'));
    echo $date.'
    '.$date_plus;

    It will be give :

    2011-11-01
    2011-11-06
    

提交回复
热议问题