Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Globalization.​UmAlQuraCalendar
Assembly: System.Runtime
Inheritance: object → Calendar → UmAlQuraCalendar
Represents the Saudi Hijri (Um Al Qura) calendar.
Fields and Constants
public const
int
UmAlQuraEra
Represents the current era. This field is constant.
Properties
public
CalendarAlgorithmType
AlgorithmType
Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both.
protected
int
DaysInYearBeforeMinSupportedYear
Gets the number of days in the year that precedes the year that is specified by the <see cref="P:System.Globalization.UmAlQuraCalendar.MinSupportedDateTime" /> property.
public
int[]
Eras
Gets a list of the eras that are supported by the current <see cref="T:System.Globalization.UmAlQuraCalendar" /> .
public
DateTime
MaxSupportedDateTime
Gets the latest date and time supported by this calendar.
public
DateTime
MinSupportedDateTime
Gets the earliest date and time supported by this calendar.
public
int
TwoDigitYearMax
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
public
bool
IsReadOnly
Gets a value indicating whether this <see cref="T:System.Globalization.Calendar" /> object is read-only.
Methods
public
DateTime
AddMonths​(DateTime time,
int months)
time
The date to which to add months. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
months
The positive or negative number of months to add.
Returns The date yielded by adding the number of months specified by the <paramref name="months" /> parameter to the date specified by the <paramref name="time" /> parameter.
Calculates a date that is a specified number of months away from a specified initial date.
public
DateTime
AddYears​(DateTime time,
int years)
time
The date to which to add years. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
years
The positive or negative number of years to add.
Returns The date yielded by adding the number of years specified by the <paramref name="years" /> parameter to the date specified by the <paramref name="time" /> parameter.
Calculates a date that is a specified number of years away from a specified initial date.
public
int
GetDayOfMonth​(DateTime time)
time
The date value to read. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
Returns An integer from 1 through 30 that represents the day of the month specified by the <paramref name="time" /> parameter.
Calculates the day of the month on which a specified date occurs.
public
DayOfWeek
GetDayOfWeek​(DateTime time)
time
The date value to read. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
Returns A <see cref="T:System.DayOfWeek" /> value that represents the day of the week specified by the <paramref name="time" /> parameter.
Calculates the day of the week on which a specified date occurs.
public
int
GetDayOfYear​(DateTime time)
time
The date value to read. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
Returns An integer from 1 through 355 that represents the day of the year specified by the <paramref name="time" /> parameter.
Calculates the day of the year on which a specified date occurs.
public
int
GetDaysInMonth​(int year,
int month,
int era)
year
A year.
month
An integer from 1 through 12 that represents a month.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns The number of days in the specified month in the specified year and era. The return value is 29 in a common year and 30 in a leap year.
Calculates the number of days in the specified month of the specified year and era.
public
int
GetDaysInYear​(int year,
int era)
year
A year.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns The number of days in the specified year and era. The number of days is 354 in a common year or 355 in a leap year.
Calculates the number of days in the specified year of the specified era.
public
int
GetEra​(DateTime time)
time
The date value to read.
Returns Always returns the <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> value.
Calculates the era in which a specified date occurs.
public
int
GetLeapMonth​(int year,
int era)
year
A year.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns Always 0 because the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class does not support leap months.
Calculates the leap month for a specified year and era.
public
int
GetMonth​(DateTime time)
time
The date value to read. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
Returns An integer from 1 through 12 that represents the month in the date specified by the <paramref name="time" /> parameter.
Calculates the month in which a specified date occurs.
public
int
GetMonthsInYear​(int year,
int era)
year
A year.
era
An era. Specify <see langword="UmAlQuaraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns Always 12.
Calculates the number of months in the specified year of the specified era.
public
int
GetYear​(DateTime time)
time
The date value to read. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).
Returns An integer that represents the year specified by the <paramref name="time" /> parameter.
Calculates the year of a date represented by a specified <see cref="T:System.DateTime" /> .
public
bool
IsLeapDay​(int year,
int month,
int day,
int era)
year
A year.
month
An integer from 1 through 12 that represents a month.
day
An integer from 1 through 30 that represents a day.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns <see langword="true" /> if the specified day is a leap day; otherwise, <see langword="false" /> . The return value is always <see langword="false" /> because the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class does not support leap days.
Determines whether the specified date is a leap day.
public
bool
IsLeapMonth​(int year,
int month,
int era)
year
A year.
month
An integer from 1 through 12 that represents a month.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns Always <see langword="false" /> because the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class does not support leap months.
Determines whether the specified month in the specified year and era is a leap month.
public
bool
IsLeapYear​(int year,
int era)
year
A year.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" /> .
Determines whether the specified year in the specified era is a leap year.
public
DateTime
ToDateTime​(int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond,
int era)
year
A year.
month
An integer from 1 through 12 that represents a month.
day
An integer from 1 through 29 that represents a day.
hour
An integer from 0 through 23 that represents an hour.
minute
An integer from 0 through 59 that represents a minute.
second
An integer from 0 through 59 that represents a second.
millisecond
An integer from 0 through 999 that represents a millisecond.
era
An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" /> .
Returns The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.
Returns a <see cref="T:System.DateTime" /> that is set to the specified date, time, and era.
public
int
ToFourDigitYear​(int year)
year
A 2-digit year from 0 through 99, or a 4-digit Um Al Qura calendar year from 1318 through 1450.
Returns If the <paramref name="year" /> parameter is a 2-digit year, the return value is the corresponding 4-digit year. If the <paramref name="year" /> parameter is a 4-digit year, the return value is the unchanged <paramref name="year" /> parameter.
Converts the specified year to a four-digit year by using the <see cref="P:System.Globalization.UmAlQuraCalendar.TwoDigitYearMax" /> property to determine the appropriate century.
public
DateTime
AddDays​(DateTime time,
int days)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to which to add days.
days
The number of days to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of days to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of days away from the specified <see cref="T:System.DateTime" /> .
public
DateTime
AddHours​(DateTime time,
int hours)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to which to add hours.
hours
The number of hours to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of hours to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of hours away from the specified <see cref="T:System.DateTime" /> .
public
DateTime
AddMilliseconds​(DateTime time,
double milliseconds)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to add milliseconds to.
milliseconds
The number of milliseconds to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of milliseconds to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of milliseconds away from the specified <see cref="T:System.DateTime" /> .
public
DateTime
AddMinutes​(DateTime time,
int minutes)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to which to add minutes.
minutes
The number of minutes to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of minutes to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of minutes away from the specified <see cref="T:System.DateTime" /> .
public
DateTime
AddSeconds​(DateTime time,
int seconds)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to which to add seconds.
seconds
The number of seconds to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of seconds to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of seconds away from the specified <see cref="T:System.DateTime" /> .
public
DateTime
AddWeeks​(DateTime time,
int weeks)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to which to add weeks.
weeks
The number of weeks to add.
Returns The <see cref="T:System.DateTime" /> that results from adding the specified number of weeks to the specified <see cref="T:System.DateTime" /> .
Returns a <see cref="T:System.DateTime" /> that is the specified number of weeks away from the specified <see cref="T:System.DateTime" /> .
public
object
Clone​()
Inherited from Calendar
Returns A new instance of <see cref="T:System.Object" /> that is the memberwise clone of the current <see cref="T:System.Globalization.Calendar" /> object.
Creates a new object that is a copy of the current <see cref="T:System.Globalization.Calendar" /> object.
public
int
GetDaysInMonth​(int year,
int month)
Inherited from Calendar
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.
Returns the number of days in the specified month and year of the current era.
public
int
GetDaysInYear​(int year)
Inherited from Calendar
year
An integer that represents the year.
Returns The number of days in the specified year in the current era.
Returns the number of days in the specified year of the current era.
public
int
GetHour​(DateTime time)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to read.
Returns An integer from 0 to 23 that represents the hour in <paramref name="time" /> .
Returns the hours value in the specified <see cref="T:System.DateTime" /> .
public
int
GetLeapMonth​(int year)
Inherited from Calendar
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 <paramref name="year" /> parameter does not represent a leap year.
Calculates the leap month for a specified year.
public
double
GetMilliseconds​(DateTime time)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to read.
Returns A double-precision floating-point number from 0 to 999 that represents the milliseconds in the <paramref name="time" /> parameter.
Returns the milliseconds value in the specified <see cref="T:System.DateTime" /> .
public
int
GetMinute​(DateTime time)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to read.
Returns An integer from 0 to 59 that represents the minutes in <paramref name="time" /> .
Returns the minutes value in the specified <see cref="T:System.DateTime" /> .
public
int
GetMonthsInYear​(int year)
Inherited from Calendar
year
An integer that represents the year.
Returns The number of months in the specified year in the current era.
Returns the number of months in the specified year in the current era.
public
int
GetSecond​(DateTime time)
Inherited from Calendar
time
The <see cref="T:System.DateTime" /> to read.
Returns An integer from 0 to 59 that represents the seconds in <paramref name="time" /> .
Returns the seconds value in the specified <see cref="T:System.DateTime" /> .
public
int
GetWeekOfYear​(DateTime time,
CalendarWeekRule rule,
DayOfWeek firstDayOfWeek)
Inherited from Calendar
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 <paramref name="time" /> parameter.
Returns the week of the year that includes the date in the specified <see cref="T:System.DateTime" /> value.
public
bool
IsLeapDay​(int year,
int month,
int day)
Inherited from Calendar
year
An integer that represents the year.
month
A positive integer that represents the month.
day
A positive integer that represents the day.
Returns <see langword="true" /> if the specified day is a leap day; otherwise, <see langword="false" /> .
Determines whether the specified date in the current era is a leap day.
public
bool
IsLeapMonth​(int year,
int month)
Inherited from Calendar
year
An integer that represents the year.
month
A positive integer that represents the month.
Returns <see langword="true" /> if the specified month is a leap month; otherwise, <see langword="false" /> .
Determines whether the specified month in the specified year in the current era is a leap month.
public
bool
IsLeapYear​(int year)
Inherited from Calendar
year
An integer that represents the year.
Returns <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" /> .
Determines whether the specified year in the current era is a leap year.
public
DateTime
ToDateTime​(int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond)
Inherited from Calendar
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 <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.
Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.