PHP date add 5 year to current date

后端 未结 10 2080
野的像风
野的像风 2020-12-01 03:47

I have this PHP code:

$end=date(\'Y-m-d\');

I use it to get the current date, and I need the date 5 years in the future, something like:

10条回答
  •  无人及你
    2020-12-01 04:10

           $date = strtotime($row['timestamp']);
           $newdate = date('d-m-Y',strtotime("+1 year",$date));
    

提交回复
热议问题