date . set date(date . getdate()+60); //60 Here is the number of days you want to add or subtract. The year and month will be added accordingly. It is worth noting that the month obtained by date.getMonth () is less than the actual month 1, so the actual month is (date.getMonth()+ 1)?
Its getMilliSeconds is also to get the milliseconds of the current time. So we need to make our own changes. You can use getMinutes and getSeconds to get the corresponding minutes and seconds, and then convert the minutes into *60* 1000+ seconds * 1000.