Date.prototype.addMonths(months)

Description:

Add specified months to the date value.

Parameters:

  • months
    • Type: Number

Returned Value:

  • Value calculated

Notice:

After calling this method, the original variable has been applied the value calculated.

Sample:

var date = new Date(2012, 4, 2, 18, 01, 03);
date.addMonths(2);
document.write(date.format("yyyy-MM-dd HH:mm:ss"));
//Result: "2012-07-02 18:01:03"

Last edited Aug 20, 2012 at 7:12 AM by rynnwang, version 1

Comments

No comments yet.