class Calendar

in global :: System . Globalization

Represents time in divisions, such as weeks, months, and years.


public DateTime AddDays( DateTime time, int days )

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

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

public DateTime AddHours( DateTime time, int hours )

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

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

public DateTime AddMilliseconds( DateTime time, double milliseconds )

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

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

public DateTime AddMinutes( DateTime time, int minutes )

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

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

public DateTime AddMonths( DateTime time, int months )

When overridden in a derived class, 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 AddSeconds( DateTime time, int seconds )

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

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

public DateTime AddWeeks( DateTime time, int weeks )

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

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

public DateTime AddYears( DateTime time, int years )

When overridden in a derived class, 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 CalendarAlgorithmType AlgorithmType { get; }

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

  • Returns One of the values.

public static int CurrentEra

Represents the current era of the current calendar. The value of this field is 0.

public int[] Eras { get; }

When overridden in a derived class, gets the list of eras in the current calendar.

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

public int GetDayOfMonth( DateTime time )

When overridden in a derived class, returns the day of the month in the specified .

  • time The to read.
  • Returns A positive integer that represents the day of the month in the parameter.

public DayOfWeek GetDayOfWeek( DateTime time )

When overridden in a derived class, returns the day of the week in the specified .

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

public int GetDayOfYear( DateTime time )

When overridden in a derived class, returns the day of the year in the specified .

  • time The to read.
  • Returns A positive integer that represents the day of the year in the parameter.

public int GetDaysInMonth( int year, int month )

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

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

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

When overridden in a derived class, returns the number of days in the specified month, year, and era.

  • year An integer that represents the year.
  • month A positive integer 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 )

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

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

public int GetDaysInYear( int year, int era )

When overridden in a derived class, returns the number of days in the specified year and 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 )

When overridden in a derived class, returns the era of the specified .

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

public int GetHour( DateTime time )

Returns the hours value in the specified .

  • time The to read.
  • Returns An integer from 0 to 23 that represents the hour in .

public int GetLeapMonth( int year )

Calculates the leap month for a specified year.

  • year A year.
  • Returns A positive integer that indicates the leap month in the specified year. -or- Zero if this calendar does not support a leap month or if the parameter does not represent a leap year.

public int GetLeapMonth( int year, int era )

Calculates the leap month for a specified year and era.

  • year A year.
  • era An era.
  • Returns A positive integer 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.

public double GetMilliseconds( DateTime time )

Returns the milliseconds value in the specified .

  • time The to read.
  • Returns A double-precision floating-point number from 0 to 999 that represents the milliseconds in the parameter.

public int GetMinute( DateTime time )

Returns the minutes value in the specified .

  • time The to read.
  • Returns An integer from 0 to 59 that represents the minutes in .

public int GetMonth( DateTime time )

When overridden in a derived class, returns the month in the specified .

  • time The to read.
  • Returns A positive integer that represents the month in .

public int GetMonthsInYear( int year )

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

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

public int GetMonthsInYear( int year, int era )

When overridden in a derived class, 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 GetSecond( DateTime time )

Returns the seconds value in the specified .

  • time The to read.
  • Returns An integer from 0 to 59 that represents the seconds in .

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

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

  • time A date and time value.
  • rule An enumeration value that defines a calendar week.
  • firstDayOfWeek An enumeration value that represents the first day of the week.
  • Returns A positive integer that represents the week of the year that includes the date in the parameter.

public int GetYear( DateTime time )

When overridden in a derived class, 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 )

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

  • year An integer that represents the year.
  • month A positive integer that represents the month.
  • day A positive integer that represents the day.
  • Returns if the specified day is a leap day; otherwise, .

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

When overridden in a derived class, determines whether the specified date in the specified era is a leap day.

  • year An integer that represents the year.
  • month A positive integer that represents the month.
  • day A positive integer 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 )

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

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

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

When overridden in a derived class, 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 A positive integer that represents the month.
  • era An integer that represents the era.
  • Returns if the specified month is a leap month; otherwise, .

public bool IsLeapYear( int year )

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

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

public bool IsLeapYear( int year, int era )

When overridden in a derived class, 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 bool IsReadOnly { get; }

Gets a value indicating whether this object is read-only.

  • Returns if this object is read-only; otherwise, .

public DateTime MaxSupportedDateTime { get; }

Gets the latest date and time supported by this object.

  • Returns The latest date and time supported by this calendar. The default is .

public DateTime MinSupportedDateTime { get; }

Gets the earliest date and time supported by this object.

  • Returns The earliest date and time supported by this calendar. The default is .

public static Calendar ReadOnly( Calendar calendar )

Returns a read-only version of the specified object.

  • calendar A object.
  • Returns The object specified by the parameter, if is read-only. -or- A read-only memberwise clone of the object specified by , if is not read-only.

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

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

  • year An integer that represents the year.
  • month A positive integer that represents the month.
  • day A positive integer 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.
  • Returns The that is set to the specified date and time in the current era.

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

When overridden in a derived class, returns a that is set to the specified date and time in the specified era.

  • year An integer that represents the year.
  • month A positive integer that represents the month.
  • day A positive integer 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 int GetHashCode( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public object Clone( )

😔 No documentation found.