AddMonths() public method

Returns a DateTime that is the specified number of months away from the specified DateTime.
The year part of the resulting DateTime is affected if the resulting month is beyond the last month of the current year. The day part of the resulting DateTime is also affected if the resulting day is not a valid day in the resulting month of the resulting year; it is changed to the last valid day in the resulting month of the resulting year. The time-of-day part of the resulting DateTime remains the same as the specified DateTime. For example, if the specified month is Ordibehesht, which is the 2nd month and has 31 days, the specified day is the 31th day of that month, and the value of the months parameter is -3, the resulting year is one less than the specified year, the resulting month is Bahman, and the resulting day is the 30th day, which is the last day in Bahman. If the value of the months parameter is negative, the resulting DateTime would be earlier than the specified DateTime.
public AddMonths ( System.DateTime time, int months ) : System.DateTime
time System.DateTime The DateTime instance to add.
months int The number of months to add.
return System.DateTime
        public void Can_Add_A_Month()
        {
            var pd  = new PersianDate(1387, 12, 30);
            var dt1 = (DateTime)pd;
            var dt2 = calendar.AddMonths(dt1, 2);

            Assert.AreEqual(dt2.Month, dt1.Month + 2);
        }