mscorlib 2.0.0.0 4.0.0.0 System.Globalization.Calendar

The Persian calendar is used in most countries where Persian is spoken, although some regions use different month names. The Persian calendar is the official calendar of Iran and Afghanistan, and it is one of the alternative calendars in regions such as Kazakhstan and Tajikistan.

For information about using the class and the other calendar classes in the .NET Framework, see Working with Calendars.

Dates in the Persian calendar start from the year of the Hijra, which corresponds to 622 C.E. and is the year when Muhammad (PBUH) migrated from Mecca to Medina. For example, the date March 21, 2002 C.E. corresponds to the first day of the month of Farvardeen in the year 1381 Anno Persico.

The Persian calendar is based on a solar year and is approximately 365 days long. A year cycles through four seasons, and a new year begins when the sun appears to cross the equator from the southern hemisphere to the northern hemisphere as viewed from the center of the Earth. The new year marks the first day of the month of Farvardeen, which is the first day of spring in the northern hemisphere.

Each of the first six months in the Persian calendar has 31 days, each of the next five months has 30 days, and the last month has 29 days in a common year and 30 days in a leap year. A leap year is a year that, when divided by 33, has a remainder of 1, 5, 9, 13, 17, 22, 26, or 30. For example, the year 1370 is a leap year because dividing it by 33 yields a remainder of 17. There are approximately eight leap years in every 33-year cycle.

## Using the PersianCalendar

Applications use a object to calculate dates in the Persian calendar or convert Persian dates to and from Gregorian dates.

Your application should not use a object as the default calendar for a culture. The default calendar is specified by the property and must be one of the calendars returned by the property. Currently, the class is not an optional calendar for any culture supported by the class and consequently cannot be a default calendar.

Represents the Persian calendar.

- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Method
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The property of the returned value always equals . You can preserve the property of the parameter by calling the method, as the following example shows.

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

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

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

  The to which to add months. The positive or negative number of months to add.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The property of the returned value always equals . You can preserve the property of the parameter by calling the method, as the following example shows.

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

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

  The object that results from adding the specified number of years to the specified object.

  The to which to add years. The positive or negative number of years to add.
- Property
  2.0.0.0
  4.0.0.0
  System.Globalization.CalendarAlgorithmType To be added.

  A date calculation for a particular calendar depends on whether the calendar is solar-based, lunar-based, or lunisolar-based.

  Gets a value indicating whether the current calendar is solar-based, lunar-based, or lunisolar-based.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32[] To be added. To be added.

  Gets the list of eras in a object.

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the day of the month in the specified object.

  An integer from 1 through 31 that represents the day of the month in the specified object.

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.DayOfWeek `` To be added.

  Returns the day of the week in the specified object.

  A value that represents the day of the week in the specified object.

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the day of the year in the specified object.

  An integer from 1 through 366 that represents the day of the year in the specified object.

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` To be added.

  Returns the number of days in the specified month of the specified year and era.

  The number of days in the specified month of the specified year and era.

  An integer from 1 through 9378 that represents the year. An integer that represents the month, and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` To be added.

  Returns the number of days in the specified year of the specified era.

  The number of days in the specified year and era. The number of days is 365 in a common year or 366 in a leap year.

  An integer from 1 through 9378 that represents the year. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the era in the specified object.

  Always returns .

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` To be added.

  Returns the leap month for a specified year and era.

  The return value is always 0.

  An integer from 1 through 9378 that represents the year to convert. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the month in the specified object.

  An integer from 1 through 12 that represents the month in the specified object.

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` To be added.

  Returns the number of months in the specified year of the specified era.

  Returns 10 if the parameter is 9378; otherwise, always returns 12.

  An integer from 1 through 9378 that represents the year. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the year in the specified object.

  An integer from 1 through 9378 that represents the year in the specified .

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` ``

  A leap day is a day that occurs only in a leap year.

  Determines whether the specified date is a leap day.

  true if the specified day is a leap day; otherwise, false.

  An integer from 1 through 9378 that represents the year. An integer that represents the month and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378. An integer from 1 through 31 that represents the day. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` To be added.

  Determines whether the specified month in the specified year and era is a leap month.

  Always returns false because the class does not support the notion of a leap month.

  An integer from 1 through 9378 that represents the year. An integer that represents the month and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added.

  Determines whether the specified year in the specified era is a leap year.

  true if the specified year is a leap year; otherwise, false.

  An integer from 1 through 9378 that represents the year. An integer from 0 through 1 that represents the era.
- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  December 31, 9999 C.E. is equivalent to the 10th day of the 10th month of the year 9378 in the Persian calendar.

  Gets the latest date and time supported by the class.

- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  March 21, 622 C.E. is equivalent to the first day of the first month of the year 0001 in the Persian calendar.

  Gets the earliest date and time supported by the class.

- Field
  2.0.0.0
  4.0.0.0
  System.Int32 1

  The value of is 1.

  Represents the current era. This field is constant.

- Method
  2.0.0.0
  4.0.0.0
  System.DateTime `` `` `` `` `` `` `` ``

  The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar.

  Returns a object that is set to the specified date, time, and era.

  A object that is set to the specified date and time in the current era.

  An integer from 1 through 9378 that represents the year. An integer from 1 through 12 that represents the month. An integer from 1 through 31 that represents the day. An integer from 0 through 23 that represents the hour. An integer from 0 through 59 that represents the minute. An integer from 0 through 59 that represents the second. An integer from 0 through 999 that represents the millisecond. An integer from 0 through 1 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method converts the parameter to a four-digit year representation using the property. The return value is the upper boundary of a 100-year range that allows a two-digit year to be properly translated to a four-digit year. For example, if the 100-year range is from 1930 through 2029, then a two-digit value of 30 is interpreted as 1930 while a two-digit value of 29 is interpreted as 2029.

  supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception.

  Converts the specified year to a four-digit year representation.

  An integer that contains the four-digit representation of .

  An integer from 1 through 9378 that represents the year to convert.
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  This property allows a 2-digit year to be properly translated to a 4-digit year. For example, if this property is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029.

  The initial value of this property is derived from the settings in the regional and language options in Control Panel. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. If the calendar is not supported in the regional and language options, the initial value of this property is the default value defined by the calendar class.

  The application should set this value to 99 to indicate that 2-digit years are to be taken literally. For example, if this property is set to 99, the 100-year range is from 0 (not a valid value for most calendars) to 99. Therefore, a 2-digit value of 30 is interpreted as 30.

  Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.