// Token: 0x06002E69 RID: 11881 RVA: 0x000B21D4 File Offset: 0x000B03D4
public DateTime AddMonths(DateTime time, int months)
{
if (months < -120000 || months > 120000)
{
throw new ArgumentOutOfRangeException("months", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), -120000, 120000));
}
this.CheckTicksRange(time.Ticks);
int num = this.GetDatePart(time.Ticks, 0);
int num2 = this.GetDatePart(time.Ticks, 2);
int num3 = this.GetDatePart(time.Ticks, 3);
int num4 = num2 - 1 + months;
if (num4 >= 0)
{
num2 = num4 % 12 + 1;
num += num4 / 12;
}
else
{
num2 = 12 + (num4 + 1) % 12;
num += (num4 - 11) / 12;
}
int[] array = (num % 4 == 0 && (num % 100 != 0 || num % 400 == 0)) ? GregorianCalendarHelper.DaysToMonth366 : GregorianCalendarHelper.DaysToMonth365;
int num5 = array[num2] - array[num2 - 1];
if (num3 > num5)
{
num3 = num5;
}
long ticks = GregorianCalendarHelper.DateToTicks(num, num2, num3) + time.Ticks % 864000000000L;
Calendar.CheckAddResult(ticks, this.m_Cal.MinSupportedDateTime, this.m_Cal.MaxSupportedDateTime);
return(new DateTime(ticks));
}