System.Globalization.ThaiBuddhistCalendar.AddMonths C# (CSharp) Method

AddMonths() public method

public AddMonths ( System.DateTime time, int months ) : System.DateTime
time System.DateTime
months int
return System.DateTime
        public override DateTime AddMonths(DateTime time, int months) {
            return (helper.AddMonths(time, months));
        }

Usage Example

        public void PosTest3()
        {
            System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
            Random rand = new Random(-55);
            int year = rand.Next(tbc.GetYear(tbc.MinSupportedDateTime), tbc.GetYear(tbc.MaxSupportedDateTime));
            int month = rand.Next(1, 12);
            int day;
            if (IsLeapYearThaiBuddhist(year))
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_LEAP_YEAR[month] + 1);
            }
            else
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_NO_LEAP_YEAR[month] + 1);
            }

            DateTime dt = tbc.ToDateTime(year, month, day, 0, 0, 0, 0);
            int addvalue = 0;
            DateTime actualDT = tbc.AddMonths(dt, addvalue);
            Assert.Equal(dt, actualDT);
        }
All Usage Examples Of System.Globalization.ThaiBuddhistCalendar::AddMonths