System.Globalization.PersianCalendar.AddMonths Method

Returns a DateTime object that is offset the specified number of months from the specified DateTime object.

Syntax

public override DateTime AddMonths (DateTime time, int months)

Parameters

time
The DateTime to which to add months.
months
The positive or negative number of months to add.

Returns

A DateTime object that represents the date yielded by adding the number of months specified by the months parameter to the date specified by the time parameter.

Remarks

The DateTime.Kind property of the returned DateTime value always equals DateTimeKind.Unspecified. You can preserve the DateTime.Kind property of the time parameter by calling the DateTime.SpecifyKind(DateTime, DateTimeKind) method, as the following example shows.

code reference: System.Globalization.Calendar.AddMethods#5

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0