Method | Description | |
---|---|---|
AddMonths ( System.DateTime time, int months ) : System.DateTime |
Returns a DateTime that is the specified number of months away from the specified DateTime. The year part of the resulting DateTime is affected if the resulting month is beyond the last month of the current year. The day part of the resulting DateTime is also 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 time-of-day part of the resulting DateTime remains the same as the specified DateTime. For example, if the specified month is Ordibehesht, which is the 2nd month and has 31 days, the specified day is the 31th day of that month, and the value of the months parameter is -3, the resulting year is one less than the specified year, the resulting month is Bahman, and the resulting day is the 30th day, which is the last day in Bahman. If the value of the months parameter is negative, the resulting DateTime would be earlier than the specified DateTime. |
|
AddYears ( System.DateTime time, int years ) : System.DateTime |
Returns a DateTime that is the specified number of years away from the specified DateTime. The day part of the resulting DateTime 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 time-of-day part of the resulting DateTime remains the same as the specified DateTime. For example, Esfand has 29 days, except during leap years when it has 30 days. If the specified Date is the 30th day of Esfand in a leap year and the value of years is 1, the resulting Date will be the 29th day of Esfand in the following year. If years is negative, the resulting DateTime would be earlier than the specified DateTime. |
|
GetCentury ( System.DateTime time ) : int |
Gets the century of the specified DateTime. A century is a whole 100-year period. So the century 14 for example, represents years 1301 through 1400. |
|
GetDayOfMonth ( System.DateTime time ) : int |
Gets the day of the month in the specified DateTime.
|
|
GetDayOfWeek ( System.DateTime time ) : DayOfWeek |
Gets the day of the week in the specified DateTime. The DayOfWeek values are Sunday which indicates YekShanbe', Monday which indicates DoShanbe', Tuesday which indicates SeShanbe', Wednesday which indicates ChaharShanbe', Thursday which indicates PanjShanbe', Friday which indicates Jom'e, and Saturday which indicates Shanbe'. |
|
GetDayOfYear ( System.DateTime time ) : int |
Gets the day of the year in the specified DateTime.
|
|
GetDaysInMonth ( int year, int month, int era ) : int |
Gets the number of days in the specified month. For example, this method might return 29 or 30 for Esfand (month = 12), depending on whether year is a leap year. |
|
GetDaysInYear ( int year, int era ) : int |
Gets the number of days in the year specified by the year and era parameters. For example, this method might return 365 or 366, depending on whether year is a leap year. |
|
GetEra ( System.DateTime time ) : int |
Gets the era in the specified DateTime. The Persian calendar recognizes one era: A.P. (Latin "Anno Persarum", which means "the year of/for Persians"). |
|
GetMonth ( System.DateTime time ) : int |
Gets the month in the specified DateTime. Month 1 indicates Farvardin, month 2 indicates Ordibehesht, month 3 indicates Khordad, month 4 indicates Tir, month 5 indicates Amordad, month 6 indicates Shahrivar, month 7 indicates Mehr, month 8 indicates Aban, month 9 indicates Azar, month 10 indicates Dey, month 11 indicates Bahman, and month 12 indicates Esfand. |
|
GetMonthsInYear ( int year, int era ) : int |
Gets the number of months in the year specified by the year and era parameters.
|
|
GetYear ( System.DateTime time ) : int |
Gets the year in the specified DateTime.
|
|
IsLeapDay ( int year, int month, int day, int era ) : bool |
Determines whether the Date specified by the year, month, day, and era parameters is a leap day. In the Persian calendar leap years are applied every 4 or 5 years according to a certain pattern that iterates in a 2820-year cycle. 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 Persian calendar, the 30th day of Esfand (month 12) is the only leap day. |
|
IsLeapMonth ( int year, int month ) : bool |
Determines whether the month specified by the year, month, and era parameters is a leap month. In the Persian calendar leap years are applied every 4 or 5 years according to a certain pattern that iterates in a 2820-year cycle. 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 Persian calendar does not have any leap months. |
|
IsLeapMonth ( int year, int month, int era ) : bool |
Determines whether the month specified by the year, month, and era parameters is a leap month. In the Persian calendar leap years are applied every 4 or 5 years according to a certain pattern that iterates in a 2820-year cycle. 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 Persian calendar does not have any leap months. |
|
IsLeapYear ( int year, int era ) : bool |
Determines whether the year specified by the year and era parameters is a leap year. In the Persian calendar leap years are applied every 4 or 5 years according to a certain pattern that iterates in a 2820-year cycle. A common year has 365 days and a leap year has 366 days. |
|
IsWithInSupportedRange ( System.DateTime dateTime ) : bool | ||
NumberOfLeapYearsUntil ( int year ) : int |
Calculates the number of leap years until -but not including- the specified year. In the Persian calendar leap years are applied every 4 or 5 years according to a certain pattern that iterates in a 2820-year cycle. A common year has 365 days and a leap year has 366 days. |
|
ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, int era ) : System.DateTime |
Returns a DateTime that is set to the specified Date and time in the specified era.
|
|
ToFourDigitYear ( int year ) : int |
Converts the specified two-digit year to a four-digit year by using the Globalization.PersianCalendar.TwoDigitYearMax property to determine the appropriate century. TwoDigitYearMax 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 year within that 100-year range. For example, if TwoDigitYearMax is set to 1429, the 100-year range is from 1330 to 1429; therefore, a 2-digit value of 30 is interpreted as 1330, while a 2-digit value of 29 is interpreted as 1429. |
Method | Description | |
---|---|---|
CheckDateRange ( bool validate, int year, int month, int day ) : void | ||
CheckEraRange ( bool validate, int era ) : void | ||
CheckMonthRange ( bool validate, int month ) : void | ||
CheckTicksRange ( bool validate, System.DateTime time ) : void | ||
CheckYearRange ( bool validate, int year ) : void | ||
GetDayOfMonth ( bool validate, System.DateTime time ) : int | ||
GetDayOfYear ( bool validate, System.DateTime time ) : int | ||
GetDaysInMonth ( bool validate, int year, int month, int era ) : int | ||
GetDaysInYear ( bool validate, int year, int era ) : int | ||
GetMonth ( bool validate, System.DateTime time ) : int | ||
GetYear ( bool validate, System.DateTime time ) : int | ||
GetYearAndRemainingDays ( bool validate, System.DateTime time, int &year, int &days ) : void | ||
IsLeapYear ( bool validate, int year, int era ) : bool | ||
NumberOfLeapYearsUntil ( bool validate, int year ) : int |
public AddMonths ( System.DateTime time, int months ) : System.DateTime | ||
time | System.DateTime | The DateTime instance to add. |
months | int | The number of months to add. |
return | System.DateTime |
public AddYears ( System.DateTime time, int years ) : System.DateTime | ||
time | System.DateTime | The DateTime instance to add. |
years | int | The number of years to add. |
return | System.DateTime |
public GetCentury ( System.DateTime time ) : int | ||
time | System.DateTime | An instance of the DateTime class to read. |
return | int |
public GetDayOfMonth ( System.DateTime time ) : int | ||
time | System.DateTime | The DateTime instance to read. |
return | int |
public GetDayOfWeek ( System.DateTime time ) : DayOfWeek | ||
time | System.DateTime | The DateTime instance to read. |
return | DayOfWeek |
public GetDayOfYear ( System.DateTime time ) : int | ||
time | System.DateTime | The DateTime instance to read. |
return | int |
public GetDaysInMonth ( int year, int month, int era ) : int | ||
year | int | An integer that represents the year. |
month | int | An integer that represents the month. |
era | int | An integer that represents the era. |
return | int |
public GetDaysInYear ( int year, int era ) : int | ||
year | int | An integer that represents the year. |
era | int | An integer that represents the era. |
return | int |
public GetEra ( System.DateTime time ) : int | ||
time | System.DateTime | The DateTime instance to read. |
return | int |
public GetMonth ( System.DateTime time ) : int | ||
time | System.DateTime | The DateTime instance to read. |
return | int |
public GetMonthsInYear ( int year, int era ) : int | ||
year | int | An integer that represents the year. |
era | int | An integer that represents the era. |
return | int |
public GetYear ( System.DateTime time ) : int | ||
time | System.DateTime | The DateTime instance to read. |
return | int |
public IsLeapDay ( int year, int month, int day, int era ) : bool | ||
year | int | An integer that represents the year. |
month | int | An integer that represents the month. |
day | int | An integer that represents the day. |
era | int | An integer that represents the era. |
return | bool |
public IsLeapMonth ( int year, int month ) : bool | ||
year | int | An integer that represents the year. |
month | int | An integer that represents the month. |
return | bool |
public IsLeapMonth ( int year, int month, int era ) : bool | ||
year | int | An integer that represents the year. |
month | int | An integer that represents the month. |
era | int | An integer that represents the era. |
return | bool |
public IsLeapYear ( int year, int era ) : bool | ||
year | int | An integer that represents the year. |
era | int | An integer that represents the era. |
return | bool |
public static IsWithInSupportedRange ( System.DateTime dateTime ) : bool | ||
dateTime | System.DateTime | |
return | bool |
public NumberOfLeapYearsUntil ( int year ) : int | ||
year | int | An integer between 1 and 9378 |
return | int |
public ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, int era ) : System.DateTime | ||
year | int | An integer that represents the year. |
month | int | An integer that represents the month. |
day | int | An integer that represents the day. |
hour | int | An integer that represents the hour. |
minute | int | An integer that represents the minute. |
second | int | An integer that represents the second. |
millisecond | int | An integer that represents the millisecond. |
era | int | An integer that represents the era. |
return | System.DateTime |
public ToFourDigitYear ( int year ) : int | ||
year | int | A two-digit integer that represents the year to convert. |
return | int |