Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Return Type

Date

Example

Code Block
languagejs
function addMonthsInDesc(date d, int noMonths){
    desc += "Date " + d + " + " + noMonths + " months = " + addMonths(d, noMonths) + "\n";
}

desc = "";
addMonthsInDesc("2012-01-31", 1);
addMonthsInDesc("2012-04-30", -2);
addMonthsInDesc("2013-01-31", 1);
addMonthsInDesc("2013-04-30", -2);
addMonthsInDesc("2012-01-31", 12);
addMonthsInDesc("2012-01-31", -1);

...