how to add current date + one month using jqueryReylin Mathew7yAsked Oct 7, 2019, 3:55 AM785sysdate + 1 Month = ?how to add?
Rajeev Punhani7y agoPosted Oct 7, 2019, 4:02 AMAccepted answerHi Reylin, Please try the below code. var x = 1; //or whatever offset var CurrentDate = new Date(); console.log("Current date:", CurrentDate); CurrentDate.setMonth(CurrentDate.getMonth() + x); console.log("Date after " + x + " months:", CurrentDate);
Reylin Mathew7y agoPosted Oct 9, 2019, 12:00 AMvar x = 1; var CurrentDate = new Date('03/31/2019'); CurrentDate.setMonth(CurrentDate.getMonth() + x); alert(CurrentDate); I HVE DOUBT , im passing March but disply mnth s mayapril mnth is missing..hw t s possible.april mth is not missing ,,hw get that mnth?
Rajeev PunhaniPosted Oct 7, 2019, 4:02 AM
Reylin MathewPosted Oct 9, 2019, 12:00 AM