mscorlib 2.0.0.0 2.0.0.0 4.0.0.0 System.Globalization.Calendar System.Runtime.InteropServices.ComVisible(true)

The class supports the sexagenary cycle of years (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year (see ), a Celestial Stem (see ), and a Terrestrial Branch (see ).

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

A year can have a leap month after any month of the year, and a month can have a leap day. For example, the method returns a positive integer that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

Each supports a set of calendars. Currently, none of the lunisolar calendar classes that derive from is used by any of the cultures supported by the class. Therefore, this class and those that derive from it can be used only to calculate dates in the East Asian lunisolar calendars. This class supports several "get" methods to describe a in the terms used by lunisolar calendars, and the method to convert from lunisolar calendar data to a .

Represents a calendar that divides time into months, days, years, and eras, and has dates that are based on cycles of the sun and the moon.

- Method
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The day part of the resulting is affected if the resulting day is not a valid day in the resulting month of the resulting year. In this case, the day part is changed to the last valid day in the resulting month of the resulting year. The year part of the resulting is affected if the resulting month is outside the year of the specified . This implementation supports only the current era. Therefore, is thrown if the resulting year is outside the era of the specified . The time-of-day part of the resulting remains the same as the specified .

  For example, if the specified month is October, which has 31 days, the specified day is the thirty-first day of that month, and the value of the parameter is 6, the resulting year is one more than the specified year, the resulting month is April, and the resulting day is the thirtieth day, which is the last day in April.

  If the value of the parameter is negative, the resulting is earlier than the specified .

  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

  Calculates the date that is the specified number of months away from the specified date.

  A new that results from adding the specified number of months to the parameter.

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

  The day part of the resulting is affected if the resulting day is not a valid day in the resulting month of the resulting year. In this case, the day part is changed to the last valid day in the resulting month of the resulting year. The month part of the resulting remains the same as the specified . This implementation supports only the current era. Therefore, is thrown if the resulting year is outside the era of the specified . The time-of-day part of the resulting remains the same as the specified .

  For example, February has 28 days, except during leap years when it has 29 days. If the specified date is the twenty-ninth day of February in a leap year and the value of the parameter is 1, the resulting date will be the twenty-eighth day of February in the following year.

  If is negative, the resulting is earlier than the specified .

  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

  Calculates the date that is the specified number of years away from the specified date.

  A new that results from adding the specified number of years to the parameter.

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

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

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

  Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle.

  A number from 1 through 10.

  An integer from 1 through 60 that represents a year in the sexagenary cycle.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Calculates the day of the month in the specified date.

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

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

  Calculates the day of the week in the specified date.

  One of the values that represents the day of the week specified in the parameter.

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

  The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by .

  Calculates the day of the year in the specified date.

  An integer from 1 through 354 in a common year, or 1 through 384 in a leap year, that represents the day of the year specified in the parameter.

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

  If the parameter is the second month, the method returns 28 or 29, depending on whether the parameter is a leap year.

  Calculates 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 that represents the year. An integer from 1 through 12 in a common year, or 1 through 13 in a leap year, that represents the month. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  The method returns 365 or 366, depending on whether the parameter is a leap year.

  Calculates the number of days in the specified year and era.

  The number of days in the specified year and era.

  An integer that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  In a calendar that supports a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number from 1 through 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

  Calculates the leap month for the specified year and era.

  A positive integer from 1 through 13 that indicates the leap month in the specified year and era.

  -or-

  Zero if this calendar does not support a leap month, or if the and parameters do not specify a leap year.

  An integer that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the month in the specified date.

  An integer from 1 to 13 that represents the month specified in the parameter.

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

  Calculates the number of months in the specified year and era.

  The number of months in the specified year in the specified era. The return value is 12 months in a common year or 13 months in a leap year.

  An integer that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date.

  A number from 1 through 60 in the sexagenary cycle that corresponds to the parameter.

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

  Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle.

  An integer from 1 through 12.

  An integer from 1 through 60 that represents a year in the sexagenary cycle.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the year in the specified date.

  An integer that represents the year in the specified .

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

  Determines whether the specified date in the specified era is a leap day.

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

  An integer that represents the year. An integer from 1 through 13 that represents the month. An integer from 1 through 31 that represents the day. An integer 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.

  true if the parameter is a leap month; otherwise, false.

  An integer that represents the year. An integer from 1 through 13 that represents the month. An integer 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 that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTime `` `` `` `` `` `` `` ``

  The method 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 that is set to the specified date, time, and era.

  A that is set to the specified date, time, and era.

  An integer that represents the year. An integer from 1 through 13 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 that represents the era.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  The method uses the property to determine the appropriate century.

  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.

  An integer that contains the four-digit representation of the parameter.

  A two-digit or four-digit integer 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, in the Gregorian calendar, 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 portion of Control Panel. However, that information can change during the life of the . The class does not detect changes in the system settings automatically.

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