How to add days in Netsuite2.0 same as nlapiAddDays() api in Suitescript1.0


Hi All,
Today I worked on Date api and found that in new Script2.0 there is no equivalent method to use .
Best way to use is as below

lets say if we want to add 10 days in todays date:
 var d = new Date();

1. As Per SuiteScript1.0
var newdate =  nlapiAddDays(d, 10);

 2. As Per Suitescript2.0:
   d.setDate(10);
  var newdate = format.format({                                              value: d,    
                   type: format.Type.DATE
                                                  });

Please comment below if you have any question or suggestions .

Thanks









































































































































































































































































































































































































































































Comments