php - add + 7 days to date format mm dd, YYYY

前端 未结 7 446
野的像风
野的像风 2021-01-31 01:48

I have date of this format March 3, 2011 in database and I need to extend it with 7 days. I mean

 $date = $date + 7
. Is there any build in function to do that ?

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 02:28

    onClose: function(selectedDate) {
    
        $("#dpTodate").datepicker("option", "minDate", selectedDate);
        var maxDate = new Date(selectedDate);
    
         maxDate.setDate(maxDate.getDate() + 6); //6 days extra in from date
    
         $("#dpTodate").datepicker("option", "maxDate", maxDate);
    }
    

提交回复
热议问题