class PersianCalendar

in global :: System . Globalization

Represents the Persian calendar.


public DateTime AddMonths( DateTime time, int months )

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

  • time The to which to add months.
  • months The positive or negative number of months to add.
  • Returns A object that represents the date yielded by adding the number of months specified by the parameter to the date specified by the parameter.

public DateTime AddYears( DateTime time, int years )

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

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

public CalendarAlgorithmType AlgorithmType { get; }

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

  • Returns Always returns .

public int[] Eras { get; }

Gets the list of eras in a object.

  • Returns An array of integers that represents the eras in a object. The array consists of a single element having a value of .

public int GetDayOfMonth( DateTime time )

Returns the day of the month in the specified object.

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

public DayOfWeek GetDayOfWeek( DateTime time )

Returns the day of the week in the specified object.

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

public int GetDayOfYear( DateTime time )

Returns the day of the year in the specified object.

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

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

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

  • year An integer from 1 through 9378 that represents the year.
  • month An integer that represents the month, and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378.
  • era An integer from 0 through 1 that represents the era.
  • Returns The number of days in the specified month of the specified year and era.

public int GetDaysInYear( int year, int era )

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

  • year An integer from 1 through 9378 that represents the year.
  • era An integer from 0 through 1 that represents the era.
  • Returns 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.

public int GetEra( DateTime time )

Returns the era in the specified object.

  • time The to read.
  • Returns Always returns .

public int GetLeapMonth( int year, int era )

Returns the leap month for a specified year and era.

  • year An integer from 1 through 9378 that represents the year to convert.
  • era An integer from 0 through 1 that represents the era.
  • Returns The return value is always 0.

public int GetMonth( DateTime time )

Returns the month in the specified object.

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

public int GetMonthsInYear( int year, int era )

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

  • year An integer from 1 through 9378 that represents the year.
  • era An integer from 0 through 1 that represents the era.
  • Returns Returns 10 if the parameter is 9378; otherwise, always returns 12.

public int GetYear( DateTime time )

Returns the year in the specified object.

  • time The to read.
  • Returns An integer from 1 through 9378 that represents the year in the specified .

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

Determines whether the specified date is a leap day.

  • year An integer from 1 through 9378 that represents the year.
  • month An integer that represents the month and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378.
  • day An integer from 1 through 31 that represents the day.
  • era An integer from 0 through 1 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 and era is a leap month.

  • year An integer from 1 through 9378 that represents the year.
  • month An integer that represents the month and ranges from 1 through 12 if is not 9378, or 1 through 10 if is 9378.
  • era An integer from 0 through 1 that represents the era.
  • Returns Always returns because the class does not support the notion of a leap month.

public bool IsLeapYear( int year, int era )

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

  • year An integer from 1 through 9378 that represents the year.
  • era An integer from 0 through 1 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 class.

  • Returns The latest date and time supported by the class.

public DateTime MinSupportedDateTime { get; }

Gets the earliest date and time supported by the class.

  • Returns The earliest date and time supported by the class.

public static int PersianEra

Represents the current era. This field is constant.

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

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

  • year An integer from 1 through 9378 that represents the year.
  • month An integer from 1 through 12 that represents the month.
  • day An integer from 1 through 31 that represents the day.
  • hour An integer from 0 through 23 that represents the hour.
  • minute An integer from 0 through 59 that represents the minute.
  • second An integer from 0 through 59 that represents the second.
  • millisecond An integer from 0 through 999 that represents the millisecond.
  • era An integer from 0 through 1 that represents the era.
  • Returns A object 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 representation.

  • year An integer from 1 through 9378 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 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 int GetMonthsInYear( int year )

😔 No documentation found.

public DateTime AddMilliseconds( DateTime time, double milliseconds )

😔 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 PersianCalendar( )

😔 No documentation found.

public object Clone( )

😔 No documentation found.

public bool IsReadOnly { get; }

😔 No documentation found.

public double GetMilliseconds( DateTime time )

😔 No documentation found.

public int GetMinute( DateTime time )

😔 No documentation found.