mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Globalization.Calendar System.Runtime.InteropServices.ComVisible(true)

The Gregorian calendar recognizes two eras: B.C. or B.C.E., and A.D. or C.E. This implementation of the class recognizes only the current era (A.D. or C.E.).

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

A leap year in the Gregorian calendar is defined as a year that is evenly divisible by 4, unless it is divisible by 100. However, years that are divisible by 400 are leap years. For example, the year 1900 was not a leap year, but the year 2000 was. A common year has 365 days and a leap year has 366 days.

The Gregorian calendar has 12 months with 28 to 31 days each: January (31 days), February (28 or 29 days), March (31 days), April (30 days), May (31 days), June (30 days), July (31 days), August (31 days), September (30 days), October (31 days), November (30 days), and December (31 days). February has 29 days during leap years and 28 during common years.

By default, all and values express dates and times in the Gregorian calendar.

The Gregorian calendar was developed as a replacement for the Julian calendar (which is represented by the class) and was first introduced in a small number of cultures on October 15, 1582. When working with historic dates that precede a culture's adoption of the Gregorian calendar, you should use the original calendar if it is available in the .NET Framework. For example, Denmark changed from the Julian calendar to the Gregorian calendar on February 19 (in the Julian calendar) or March 1 (in the Gregorian calendar) of 1700. In this case, for dates before the adoption of the Gregorian calendar, you should use the Julian calendar. However, note that no culture offers intrinsic support for the class. You must use the class as a standalone calendar. For more information, see Working with Calendars.

The following example illustrates that February 18, 1700 in the Julian calendar, which is the last day the Julian calendar was officially used in Denmark, is one day earlier than March 1, 1700 in the Gregorian calendar.

code reference: System.Globalization.GregorianCalendar.Class#1

Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application can set the property to a new .

ignores punctuation in abbreviated era names, only if the is selected in and the culture uses "A.D." as the era name, that is, "A.D." is equivalent to "AD".

Represents the Gregorian calendar.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The default value is . If the property of the is set to a that is created with this constructor, the dates and times are localized in the language associated with the .

  Initializes a new instance of the class using the default value.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class using the specified value.

  The value that denotes which language version of the calendar to create.
- Method
  1.0.5000.0
  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. It 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 31st 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 30th 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

  Returns a that is the specified number of months away from the specified .

  The that results from adding the specified number of months to the specified .

  The to which to add months. The number of months to add.
- Method
  1.0.5000.0
  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. It 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 29th day of February in a leap year and the value of is 1, the resulting date will be the 28th 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

  Returns a that is the specified number of years away from the specified .

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

  The to which to add years. The number of years to add.
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 1

  The Gregorian calendar recognizes two eras: B.C. or B.C.E., and A.D. or C.E. This implementation of the class recognizes only the current era (A.D. or C.E.). This field always returns 1.

  Represents the current era. This field is constant.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Globalization.CalendarAlgorithmType To be added. To be added.

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

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Globalization.GregorianCalendarTypes To be added: an object of type 'GregorianCalendarTypes' To be added

  Gets or sets the value that denotes the language version of the current .

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

  The Gregorian calendar recognizes two eras: B.C. or B.C.E., and A.D. or C.E. This implementation of the class recognizes only the current era (A.D. or C.E.). This property always returns an array with only one element.

  Gets the list of eras in the .

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

  Returns the day of the month in the specified .

  An integer from 1 to 31 that represents the day of the month in .

  The to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DayOfWeek ``

  The values are Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.

  Returns the day of the week in the specified .

  A value that represents the day of the week in .

  The to read.
- Method
  1.0.5000.0
  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 .

  Returns the day of the year in the specified .

  An integer from 1 to 366 that represents the day of the year in .

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

  For example, this method returns 28 or 29 for February ( = 2), depending on whether is a leap year.

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

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

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  For example, this method returns 365 or 366, depending on whether is a leap year.

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

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

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

  The Gregorian calendar recognizes two eras: B.C. or B.C.E., and A.D. or C.E. This implementation of the class recognizes only the current era (A.D. or C.E.).

  Returns the era in the specified .

  An integer that represents the era in .

  The to read.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` To be added.

  Calculates the leap month for a specified year and era.

  Always 0 because the Gregorian calendar does not recognize leap months.

  A year. An era. Specify either or GregorianCalendar.Eras[Calendar.CurrentEra].
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the month in the specified .

  An integer from 1 to 12 that represents the month in .

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

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

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

  An integer that represents the year. An integer that represents the era.
- Method
  2.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` ``

  This method can be used to determine the number of weeks in the year by setting the parameter to the last day of the year.

  The property contains culture-specific values that can be used for the and parameters.

  The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of .

  The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of .

  For example, in , the method for January 1 returns 1.

  Returns the week of the year that includes the date in the specified object.

  A 1-based integer that represents the week of the year that includes the date in the parameter.

  The object to read. One of the values that defines a calendar week. One of the values that represents the first day of the week.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Returns the year in the specified .

  An integer that represents the year in .

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

  A leap year in the Gregorian calendar is defined as a year that is evenly divisible by four, except if it is divisible by 100. However, years that are divisible by 400 are leap years. For example, the year 1900 was not a leap year, but the year 2000 was. A common year has 365 days and a leap year has 366 days.

  A leap day is a day that occurs only in a leap year. In the Gregorian calendar, the 29th day of February is the only leap day.

  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 to 12 that represents the month. An integer from 1 to 31 that represents the day. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` ``

  A leap year in the Gregorian calendar is defined as a year that is evenly divisible by four, except if it is divisible by 100. However, years that are divisible by 400 are leap years. For example, the year 1900 was not a leap year, but the year 2000 was. A common year has 365 days and a leap year has 366 days.

  A leap month is an entire month that occurs only in a leap year. The Gregorian calendar does not have any leap months.

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

  This method always returns false, unless overridden by a derived class.

  An integer that represents the year. An integer from 1 to 12 that represents the month. An integer that represents the era.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  A leap year in the Gregorian calendar is defined as a year that is evenly divisible by four, except if it is divisible by 100. However, years that are divisible by 400 are leap years. For example, the year 1900 was not a leap year, but the year 2000 was. A common year has 365 days and a leap year has 366 days.

  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.
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added. To be added.

  Gets the latest date and time supported by the type.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added.

  Although the value of the property is the first moment of January 1, 0001 C.E., the Gregorian calendar was not introduced until October 15, 1582, and its adoption throughout the European continent and worldwide was slow. Until they adopted the Gregorian calendar, most cultures in the European, American, and Australian continents used the Julian calendar, which is represented by the class.

  Gets the earliest date and time supported by the type.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` `` `` `` `` `` `` `` To be added.

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

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

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

  is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit within that 100-year range. For example, if 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.

  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 by using the property to determine the appropriate century.

  An integer that contains the four-digit representation of .

  A two-digit or four-digit integer that represents the year to convert.
- Property
  1.0.5000.0
  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 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.

  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.