class GregorianCalendar

in global :: System . Globalization

Represents the Gregorian calendar.


public GregorianCalendar( GregorianCalendarTypes type )

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

  • type The value that denotes which language version of the calendar to create.

public DateTime AddMonths( DateTime time, int months )

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

  • time The to which to add months.
  • months The number of months to add.
  • Returns The that results from adding the specified number of months to the specified .

public DateTime AddYears( DateTime time, int years )

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

  • time The to which to add years.
  • years The number of years to add.
  • Returns The that results from adding the specified number of years to the specified .

public static int ADEra

Represents the current era. This field is constant.

public CalendarAlgorithmType AlgorithmType { get; }

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

  • Returns Always returns .

public GregorianCalendarTypes CalendarType { get; set; }

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

  • Returns A value that denotes the language version of the current .

public int[] Eras { get; }

Gets the list of eras in the .

  • Returns An array of integers that represents the eras in the .

public int GetDayOfMonth( DateTime time )

Returns the day of the month in the specified .

  • time The to read.
  • Returns An integer from 1 to 31 that represents the day of the month in .

public DayOfWeek GetDayOfWeek( DateTime time )

Returns the day of the week in the specified .

  • time The to read.
  • Returns A value that represents the day of the week in .

public int GetDayOfYear( DateTime time )

Returns the day of the year in the specified .

  • time The to read.
  • Returns An integer from 1 to 366 that represents the day of the year in .

public int GetDaysInMonth( int year, int month, int era )

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

  • year An integer that represents the year.
  • month An integer from 1 to 12 that represents the month.
  • era An integer that represents the era.
  • Returns The number of days in the specified month in the specified year in the specified era.

public int GetDaysInYear( int year, int era )

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

  • year An integer that represents the year.
  • era An integer that represents the era.
  • Returns The number of days in the specified year in the specified era.

public int GetEra( DateTime time )

Returns the era in the specified .

  • time The to read.
  • Returns An integer that represents the era in .

public int GetLeapMonth( int year, int era )

Calculates the leap month for a specified year and era.

  • year A year.
  • era An era. Specify either or .
  • Returns Always 0 because the Gregorian calendar does not recognize leap months.

public int GetMonth( DateTime time )

Returns the month in the specified .

  • time The to read.
  • Returns An integer from 1 to 12 that represents the month in .

public int GetMonthsInYear( int year, int era )

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

  • year An integer that represents the year.
  • era An integer that represents the era.
  • Returns The number of months in the specified year in the specified era.

public int GetYear( DateTime time )

Returns the year in the specified .

  • time The to read.
  • Returns An integer that represents the year in .

public bool IsLeapDay( int year, int month, int day, int era )

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

  • year An integer that represents the year.
  • month An integer from 1 to 12 that represents the month.
  • day An integer from 1 to 31 that represents the day.
  • era An integer that represents the era.
  • Returns if the specified day is a leap day; otherwise, .

public bool IsLeapMonth( int year, int month, int era )

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

  • year An integer that represents the year.
  • month An integer from 1 to 12 that represents the month.
  • era An integer that represents the era.
  • Returns This method always returns , unless overridden by a derived class.

public bool IsLeapYear( int year, int era )

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

  • year An integer that represents the year.
  • era An integer that represents the era.
  • Returns if the specified year is a leap year; otherwise, .

public DateTime MaxSupportedDateTime { get; }

Gets the latest date and time supported by the type.

  • Returns The latest date and time supported by the type, which is the last moment of December 31, 9999 C.E. and is equivalent to .

public DateTime MinSupportedDateTime { get; }

Gets the earliest date and time supported by the type.

  • Returns The earliest date and time supported by the type, which is the first moment of January 1, 0001 C.E. and is equivalent to .

public DateTime ToDateTime( int year, int month, int day, int hour, int minute, int second, int millisecond, int era )

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

  • year An integer that represents the year.
  • month An integer from 1 to 12 that represents the month.
  • day An integer from 1 to 31 that represents the day.
  • hour An integer from 0 to 23 that represents the hour.
  • minute An integer from 0 to 59 that represents the minute.
  • second An integer from 0 to 59 that represents the second.
  • millisecond An integer from 0 to 999 that represents the millisecond.
  • era An integer that represents the era.
  • Returns The that is set to the specified date and time in the current era.

public int ToFourDigitYear( int year )

Converts the specified year to a four-digit year by using the property to determine the appropriate century.

  • year A two-digit or four-digit integer that represents the year to convert.
  • Returns An integer that contains the four-digit representation of .

public int TwoDigitYearMax { get; set; }

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

  • Returns The last year of a 100-year range that can be represented by a 2-digit year.

public GregorianCalendar( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public DateTime ToDateTime( int year, int month, int day, int hour, int minute, int second, int millisecond )

😔 No documentation found.

public bool IsLeapYear( int year )

😔 No documentation found.

public int GetLeapMonth( int year )

😔 No documentation found.

public bool IsLeapMonth( int year, int month )

😔 No documentation found.

public bool IsLeapDay( int year, int month, int day )

😔 No documentation found.

public int GetWeekOfYear( DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek )

😔 No documentation found.

public int GetSecond( DateTime time )

😔 No documentation found.

public DateTime AddMilliseconds( DateTime time, double milliseconds )

😔 No documentation found.

public double GetMilliseconds( DateTime time )

😔 No documentation found.

public int GetHour( DateTime time )

😔 No documentation found.

public int GetDaysInYear( int year )

😔 No documentation found.

public int GetDaysInMonth( int year, int month )

😔 No documentation found.

public DateTime AddWeeks( DateTime time, int weeks )

😔 No documentation found.

public DateTime AddSeconds( DateTime time, int seconds )

😔 No documentation found.

public DateTime AddMinutes( DateTime time, int minutes )

😔 No documentation found.

public DateTime AddHours( DateTime time, int hours )

😔 No documentation found.

public DateTime AddDays( DateTime time, int days )

😔 No documentation found.

public object Clone( )

😔 No documentation found.

public bool IsReadOnly { get; }

😔 No documentation found.

public int GetMinute( DateTime time )

😔 No documentation found.

public int GetMonthsInYear( int year )

😔 No documentation found.