System.Globalization.HebrewCalendar Class

Assembly: Mscorlib.dll
Namespace: System.Globalization
Summary
Represents the Hebrew calendar.
C# Syntax:
[Serializable]
public class HebrewCalendar : Calendar
Remarks
The Hebrew calendar recognizes two eras: B.C.E. (before the common era) and A.M. (Latin "Anno Mundi", which means "the year of the world"). This implementation of the HebrewCalendar class recognizes only the current era (A.M.) and only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

In every 19-year cycle that ends with a year that is evenly divisible by 19, the 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years are leap years. A common year can have from 353 to 355 days, depending on the placement of Jewish holidays. A leap year can have from 383 to 385 days.

The Hebrew calendar has 12 months during common years and 13 months during leap years:



GetMonth value (common year) GetMonth value (leap year) Month Days in common years Days in leap years
1 1 תשרי (Tishrei) 30 30
2 2 חשון (Cheshvan) 29/30 29/30
3 3 כסלו (Kislev) 29/30 29/30
4 4 טבת (Tevet) 29 29
5 5 שבט (Shevat) 30 30
6 - אדר (Adar) 29 -
- 6 אדר א (Adar Alef ) - 30
- 7 אדר ב (Adar Beit) - 29
7 8 ניסן (Nissan) 30 30
8 9 אייר (Iyar) 29 29
9 10 סיון (Sivan) 30 30
10 11 תמוז (Tamuz) 29 29
11 12 אב (Av) 30 30
12 13 אלול (Elul) 29 29

The days in Cheshvan and Kislev vary depending on the placement of Jewish holidays. During leap years, Adar is replaced by Adar Alef with 30 days and Adar Beit with 29 days. Adar Beit is considered the leap month. The last day of Adar Alef and all the days in Adar Beit are considered leap days.

The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the sixth day of Tevet in the year 5761 A.M. in the Hebrew calendar.

See also:
System.Globalization Namespace | Calendar

System.Globalization.HebrewCalendar Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the HebrewCalendar class.
Public Fields
HebrewEra Represents the current era. This field is constant.
Public Properties
Eras Read-only

Overridden:
Gets the list of eras in the HebrewCalendar.
TwoDigitYearMax Read-write

Overridden:
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
Public Methods
AddDays
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddDays


Returns a DateTime that is the specified number of days away from the specified DateTime.
AddHours
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddHours


Returns a DateTime that is the specified number of hours away from the specified DateTime.
AddMilliseconds
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddMilliseconds


Returns a DateTime that is the specified number of milliseconds away from the specified DateTime.
AddMinutes
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddMinutes


Returns a DateTime that is the specified number of minutes away from the specified DateTime.
AddMonths Overridden:
Returns a DateTime that is the specified number of months away from the specified DateTime.
AddSeconds
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddSeconds


Returns a DateTime that is the specified number of seconds away from the specified DateTime.
AddWeeks
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.AddWeeks


Returns a DateTime that is the specified number of weeks away from the specified DateTime.
AddYears Overridden:
Returns a DateTime that is the specified number of years away from the specified DateTime.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetDayOfMonth Overridden:
Returns the day of the month in the specified DateTime.
GetDayOfWeek Overridden:
Returns the day of the week in the specified DateTime.
GetDayOfYear Overridden:
Returns the day of the year in the specified DateTime.
GetDaysInMonth
(inherited from System.Globalization.Calendar)
Overloaded:
GetDaysInMonth(int year, int month)

See base class member description: System.Globalization.Calendar.GetDaysInMonth


Returns the number of days in the specified month in the specified year in the current era.
GetDaysInMonth Overloaded:
GetDaysInMonth(int year, int month, int era)

Overridden:
Returns the number of days in the specified month in the specified year in the specified era.
GetDaysInYear
(inherited from System.Globalization.Calendar)
Overloaded:
GetDaysInYear(int year)

See base class member description: System.Globalization.Calendar.GetDaysInYear


Returns the number of days in the specified year in the current era.
GetDaysInYear Overloaded:
GetDaysInYear(int year, int era)

Overridden:
Returns the number of days in the specified year in the specified era.
GetEra Overridden:
Returns the era in the specified DateTime.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetHour
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.GetHour


Returns the hours value in the specified DateTime.
GetMilliseconds
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.GetMilliseconds


Returns the milliseconds value in the specified DateTime.
GetMinute
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.GetMinute


Returns the minutes value in the specified DateTime.
GetMonth Overridden:
Returns the month in the specified DateTime.
GetMonthsInYear
(inherited from System.Globalization.Calendar)
Overloaded:
GetMonthsInYear(int year)

See base class member description: System.Globalization.Calendar.GetMonthsInYear


Returns the number of months in the specified year in the current era.
GetMonthsInYear Overloaded:
GetMonthsInYear(int year, int era)

Overridden:
Returns the number of months in the specified year in the specified era.
GetSecond
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.GetSecond


Returns the seconds value in the specified DateTime.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
GetWeekOfYear
(inherited from System.Globalization.Calendar)
See base class member description: System.Globalization.Calendar.GetWeekOfYear


Returns the week of the year that includes the date in the specified DateTime.
GetYear Overridden:
Returns the year in the specified DateTime.
IsLeapDay
(inherited from System.Globalization.Calendar)
Overloaded:
IsLeapDay(int year, int month, int day)

See base class member description: System.Globalization.Calendar.IsLeapDay


Determines whether the specified date in the current era is a leap day.
IsLeapDay Overloaded:
IsLeapDay(int year, int month, int day, int era)

Overridden:
Determines whether the specified date in the specified era is a leap day.
IsLeapMonth
(inherited from System.Globalization.Calendar)
Overloaded:
IsLeapMonth(int year, int month)

See base class member description: System.Globalization.Calendar.IsLeapMonth


Determines whether the specified month in the specified year in the current era is a leap month.
IsLeapMonth Overloaded:
IsLeapMonth(int year, int month, int era)

Overridden:
Determines whether the specified month in the specified year in the specified era is a leap month.
IsLeapYear
(inherited from System.Globalization.Calendar)
Overloaded:
IsLeapYear(int year)

See base class member description: System.Globalization.Calendar.IsLeapYear


Determines whether the specified year in the current era is a leap year.
IsLeapYear Overloaded:
IsLeapYear(int year, int era)

Overridden:
Determines whether the specified year in the specified era is a leap year.
ToDateTime
(inherited from System.Globalization.Calendar)
Overloaded:
ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)

See base class member description: System.Globalization.Calendar.ToDateTime


Returns a DateTime that is set to the specified date and time in the current era.
ToDateTime Overloaded:
ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)

Overridden:
Returns a DateTime that is set to the specified date and time in the specified era.
ToFourDigitYear Overridden:
Converts the specified two-digit year to a four-digit year by using the HebrewCalendar.TwoDigitYearMax property to determine the appropriate century.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Globalization.HebrewCalendar Member Details

ctor #1
Summary
Initializes a new instance of the HebrewCalendar class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public HebrewCalendar();

Return to top


Field: HebrewEra
Summary
Represents the current era. This field is constant.
C# Syntax:
public static readonly int HebrewEra;
Remarks
The Hebrew calendar recognizes two eras: B.C.E. (before the common era) and A.M. (Latin "Anno Mundi", which means "the year of the world"). This implementation of the HebrewCalendar class recognizes only the current era (A.M.). This field always returns 1.

Return to top


Overridden Property: Eras (read-only)
Summary
Gets the list of eras in the HebrewCalendar.
C# Syntax:
public override int[] Eras {get;}
Remarks
The Hebrew calendar recognizes two eras: B.C.E. (before the common era) and A.M. (Latin "Anno Mundi", which means "the year of the world"). This implementation of the HebrewCalendar class recognizes only the current era (A.M.). This property always returns an array with only one element.

Return to top


Overridden Property: TwoDigitYearMax (read-write)
Summary
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
C# Syntax:
public override int TwoDigitYearMax {get; set;}
Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

This property allows a 2-digit year to be properly translated to a 4-digit year. For example, if this property is set to 5729, the 100-year range is from 5630 to 5729; therefore, a 2-digit value of 30 is interpreted as 5630, while a 2-digit value of 29 is interpreted as 5729.

The initial value of this property is derived from the settings in Regional and Language Options (or Regional Options or Regional Settings) in Control Panel in Windows. However, that information can change during the life of the AppDomain. The HebrewCalendar class does not detect changes in the system settings automatically.

See also:
HebrewCalendar.ToFourDigitYear

Return to top


Method: AddDays(
   DateTime time,
   int days
)
Inherited
See base class member description: System.Globalization.Calendar.AddDays

Summary
Returns a DateTime that is the specified number of days away from the specified DateTime.
C# Syntax:
public virtual DateTime AddDays(
   DateTime time,
   int days
);
Parameters:

time

The DateTime to which to add days.

days

The number of days to add.

Return Value:
The DateTime that results from adding the specified number of days to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
The days value is rounded to the nearest millisecond before it is added to the specified DateTime. If days is negative, the resulting DateTime is earlier than the specified DateTime.
See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddWeeks | Calendar.AddHours | Calendar.AddMinutes | Calendar.AddSeconds | Calendar.AddMilliseconds

Return to top


Method: AddHours(
   DateTime time,
   int hours
)
Inherited
See base class member description: System.Globalization.Calendar.AddHours

Summary
Returns a DateTime that is the specified number of hours away from the specified DateTime.
C# Syntax:
public virtual DateTime AddHours(
   DateTime time,
   int hours
);
Parameters:

time

The DateTime to which to add hours.

hours

The number of hours to add.

Return Value:
The DateTime that results from adding the specified number of hours to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
The hours value is rounded to the nearest millisecond before it is added to the specified DateTime. If hours is negative, the resulting DateTime is earlier than the specified DateTime.
See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddWeeks | Calendar.AddDays | Calendar.AddMinutes | Calendar.AddSeconds | Calendar.AddMilliseconds

Return to top


Method: AddMilliseconds(
   DateTime time,
   double milliseconds
)
Inherited
See base class member description: System.Globalization.Calendar.AddMilliseconds

Summary
Returns a DateTime that is the specified number of milliseconds away from the specified DateTime.
C# Syntax:
public virtual DateTime AddMilliseconds(
   DateTime time,
   double milliseconds
);
Parameters:

time

The DateTime to which to add milliseconds.

milliseconds

The number of milliseconds to add.

Return Value:
The DateTime that results from adding the specified number of milliseconds to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
The milliseconds value is rounded to the nearest integer before it is added to the specified DateTime. If milliseconds is negative, the resulting DateTime is earlier than the specified DateTime.
See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddWeeks | Calendar.AddDays | Calendar.AddHours | Calendar.AddMinutes | Calendar.AddSeconds

Return to top


Method: AddMinutes(
   DateTime time,
   int minutes
)
Inherited
See base class member description: System.Globalization.Calendar.AddMinutes

Summary
Returns a DateTime that is the specified number of minutes away from the specified DateTime.
C# Syntax:
public virtual DateTime AddMinutes(
   DateTime time,
   int minutes
);
Parameters:

time

The DateTime to which to add minutes.

minutes

The number of minutes to add.

Return Value:
The DateTime that results from adding the specified number of minutes to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
The minutes value is rounded to the nearest millisecond before it is added to the specified DateTime. If minutes is negative, the resulting DateTime is earlier than the specified DateTime.
See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddWeeks | Calendar.AddDays | Calendar.AddHours | Calendar.AddSeconds | Calendar.AddMilliseconds

Return to top


Overridden Method: AddMonths(
   DateTime time,
   int months
)
Summary
Returns a DateTime that is the specified number of months away from the specified DateTime.
C# Syntax:
public override DateTime AddMonths(
   DateTime time,
   int months
);
Parameters:

time

The DateTime to which to add months.

months

The number of months to add.

Return Value:
The DateTime that results from adding the specified number of months to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
ArgumentOutOfRangeException months is less than -120000.

-or-

months is greater than 120000.

Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

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 Av, which has 30 days, the specified day is the 30th day of that month, and the value of the months parameter is 5, the resulting year is one more than the specified year, the resulting month is Tevet, and the resulting day is the 29th day, which is the last day in Tevet.

If the value of the months parameter is negative, the resulting DateTime is earlier than the specified DateTime.

See also:
DateTime | HebrewCalendar.AddYears

Return to top


Method: AddSeconds(
   DateTime time,
   int seconds
)
Inherited
See base class member description: System.Globalization.Calendar.AddSeconds

Summary
Returns a DateTime that is the specified number of seconds away from the specified DateTime.
C# Syntax:
public virtual DateTime AddSeconds(
   DateTime time,
   int seconds
);
Parameters:

time

The DateTime to which to add seconds.

seconds

The number of seconds to add.

Return Value:
The DateTime that results from adding the specified number of seconds to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
The value parameter is rounded to the nearest millisecond before it is added to the specified DateTime. If value is negative, the resulting DateTime is earlier than the specified DateTime.
See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddWeeks | Calendar.AddDays | Calendar.AddHours | Calendar.AddMinutes | Calendar.AddMilliseconds

Return to top


Method: AddWeeks(
   DateTime time,
   int weeks
)
Inherited
See base class member description: System.Globalization.Calendar.AddWeeks

Summary
Returns a DateTime that is the specified number of weeks away from the specified DateTime.
C# Syntax:
public virtual DateTime AddWeeks(
   DateTime time,
   int weeks
);
Parameters:

time

The DateTime to which to add weeks.

weeks

The number of weeks to add.

Return Value:
The DateTime that results from adding the specified number of weeks to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
If weeks is negative, the resulting DateTime is earlier than the specified DateTime.

In all .NET Framework classes derived from the Calendar class, a week is defined as seven days, except the first and last weeks of the year which might have less than seven days.

See also:
DateTime | Calendar.AddYears | Calendar.AddMonths | Calendar.AddDays | Calendar.AddHours | Calendar.AddMinutes | Calendar.AddSeconds | Calendar.AddMilliseconds

Return to top


Overridden Method: AddYears(
   DateTime time,
   int years
)
Summary
Returns a DateTime that is the specified number of years away from the specified DateTime.
C# Syntax:
public override DateTime AddYears(
   DateTime time,
   int years
);
Parameters:

time

The DateTime to which to add years.

years

The number of years to add.

Return Value:
The DateTime that results from adding the specified number of years to the specified DateTime.
Exceptions
Exception Type Condition
ArgumentException The resulting DateTime is outside the supported range.
Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

The month part of the resulting DateTime is affected if the resulting month is not a valid month in the resulting year; it is changed to the last valid month in the resulting year. For example, if the month in the time parameter is the 13th month of a leap year and the value of years is 1, the month in the resulting DateTime is the 12th month of the following year, which is a non-leap year.

Note that although the month part of DateTime does not change, it might still refer to a different month. For example, Adar Beit is the 7th month in leap years, but Nissan is the 7th month in common years.

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. For example, Cheshvan can have 29 or 30 days, depending on the placement of Jewish holidays. Suppose that Cheshvan has 30 days in the current year and 29 in the following year. If the specified date is the 30th day of Cheshvan in the current year and the value of years is 1, the resulting date will be the 29th day of Cheshvan in the following year.

The time-of-day part of the resulting DateTime remains the same as the specified DateTime.

If years is negative, the resulting DateTime is earlier than the specified DateTime.

See also:
DateTime | HebrewCalendar.AddMonths

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~HebrewCalendar();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetDayOfMonth(
   DateTime time
)
Summary
Returns the day of the month in the specified DateTime.
C# Syntax:
public override int GetDayOfMonth(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer from 1 to 30 that represents the day of the month in the specified DateTime.
See also:
DateTime.Day | HebrewCalendar.GetEra | HebrewCalendar.GetYear | HebrewCalendar.GetMonth | HebrewCalendar.GetDayOfYear | HebrewCalendar.GetDayOfWeek

Return to top


Overridden Method: GetDayOfWeek(
   DateTime time
)
Summary
Returns the day of the week in the specified DateTime.
C# Syntax:
public override DayOfWeek GetDayOfWeek(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
A DayOfWeek value that represents the day of the week in the specified DateTime.
Remarks
The DayOfWeek values are as follows:

DayOfWeek value which indicates
Sunday יום ראשון (Yom Rishon)
Monday יום שני (Yom Sheni)
Tuesday יום שלישי (Yom Shlishi)
Wednesday יום רביעי (Yom Reviee)
Thursday יום חמישי (Yom Chamishi)
Friday יום שישי (Yom Shishi)
Saturday שבת (Shabat)
See also:
DateTime.DayOfWeek | DayOfWeek | HebrewCalendar.GetEra | HebrewCalendar.GetYear | HebrewCalendar.GetMonth | HebrewCalendar.GetDayOfYear | HebrewCalendar.GetDayOfMonth

Return to top


Overridden Method: GetDayOfYear(
   DateTime time
)
Summary
Returns the day of the year in the specified DateTime.
C# Syntax:
public override int GetDayOfYear(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer from 1 to 385 that represents the day of the year in the specified DateTime.
Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).
See also:
DateTime.DayOfYear | HebrewCalendar.GetEra | HebrewCalendar.GetYear | HebrewCalendar.GetMonth | HebrewCalendar.GetDayOfMonth | HebrewCalendar.GetDayOfWeek

Return to top


Overloaded Method: GetDaysInMonth(
   int year,
   int month
)
Inherited
See base class member description: System.Globalization.Calendar.GetDaysInMonth

Summary
Returns the number of days in the specified month in the specified year in the current era.
C# Syntax:
public virtual int GetDaysInMonth(
   int year,
   int month
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

Return Value:
The number of days in the specified month in the specified year in the current era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

Remarks
For example, in the Gregorian calendar, this method returns 28 or 29 for February (month = 2), depending on whether year is a leap year.
See also:
GregorianCalendar | Calendar.GetMonthsInYear | Calendar.GetDaysInYear

Return to top


Overloaded Method: GetDaysInMonth(
   int year,
   int month,
   int era
)
Summary
Returns the number of days in the specified month in the specified year in the specified era.
C# Syntax:
public override int GetDaysInMonth(
   int year,
   int month,
   int era
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

era

An integer that represents the era.

Return Value:
The number of days in the specified month in the specified year in the specified era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Remarks
For example, this method returns 29 or 30 for Cheshvan, depending on the placement of Jewish holidays.

This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

See also:
HebrewCalendar.Eras | HebrewCalendar.GetMonthsInYear | HebrewCalendar.GetDaysInYear

Return to top


Overloaded Method: GetDaysInYear(
   int year
)
Inherited
See base class member description: System.Globalization.Calendar.GetDaysInYear

Summary
Returns the number of days in the specified year in the current era.
C# Syntax:
public virtual int GetDaysInYear(
   int year
);
Parameters:

year

An integer that represents the year.

Return Value:
The number of days in the specified year in the current era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.
Remarks
For example, in the Gregorian calendar, this method returns 365 or 366, depending on whether year is a leap year.
See also:
GregorianCalendar | Calendar.GetMonthsInYear | Calendar.GetDaysInMonth

Return to top


Overloaded Method: GetDaysInYear(
   int year,
   int era
)
Summary
Returns the number of days in the specified year in the specified era.
C# Syntax:
public override int GetDaysInYear(
   int year,
   int era
);
Parameters:

year

An integer that represents the year.

era

An integer that represents the era.

Return Value:
The number of days in the specified year in the specified era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar. -or-

era is outside the range supported by the calendar.

Remarks
For example, this method returns an integer from 353 to 355 or from 383 to 385, depending on the placement of Jewish holidays and depending on whether year is a leap year.

This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

See also:
HebrewCalendar.Eras | HebrewCalendar.GetMonthsInYear | HebrewCalendar.GetDaysInMonth

Return to top


Overridden Method: GetEra(
   DateTime time
)
Summary
Returns the era in the specified DateTime.
C# Syntax:
public override int GetEra(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer that represents the era in the specified DateTime.
Remarks
The Hebrew calendar recognizes two eras: B.C.E. (before the common era) and A.M. (Latin "Anno Mundi", which means "the year of the world"). This implementation of the HebrewCalendar class recognizes only the current era (A.M.) and only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).
See also:
DateTime | HebrewCalendar.Eras | HebrewCalendar.GetYear | HebrewCalendar.GetMonth | HebrewCalendar.GetDayOfYear | HebrewCalendar.GetDayOfMonth | HebrewCalendar.GetDayOfWeek

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHour(
   DateTime time
)
Inherited
See base class member description: System.Globalization.Calendar.GetHour

Summary
Returns the hours value in the specified DateTime.
C# Syntax:
public virtual int GetHour(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer from 0 to 23 that represents the hour in time.
See also:
DateTime.Hour | Calendar.GetEra | Calendar.GetYear | Calendar.GetMonth | Calendar.GetWeekOfYear | Calendar.GetDayOfYear | Calendar.GetDayOfMonth | Calendar.GetDayOfWeek | Calendar.GetMinute | Calendar.GetSecond | Calendar.GetMilliseconds

Return to top


Method: GetMilliseconds(
   DateTime time
)
Inherited
See base class member description: System.Globalization.Calendar.GetMilliseconds

Summary
Returns the milliseconds value in the specified DateTime.
C# Syntax:
public virtual double GetMilliseconds(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer that represents the milliseconds in time.
Remarks
The returned value is an integer from 0 to 999.
See also:
DateTime.Millisecond | Calendar.GetEra | Calendar.GetYear | Calendar.GetMonth | Calendar.GetWeekOfYear | Calendar.GetDayOfYear | Calendar.GetDayOfMonth | Calendar.GetDayOfWeek | Calendar.GetHour | Calendar.GetMinute | Calendar.GetSecond

Return to top


Method: GetMinute(
   DateTime time
)
Inherited
See base class member description: System.Globalization.Calendar.GetMinute

Summary
Returns the minutes value in the specified DateTime.
C# Syntax:
public virtual int GetMinute(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer that represents the minutes in time.
Remarks
The returned value is an integer from 0 to 59.
See also:
DateTime.Minute | Calendar.GetEra | Calendar.GetYear | Calendar.GetMonth | Calendar.GetWeekOfYear | Calendar.GetDayOfYear | Calendar.GetDayOfMonth | Calendar.GetDayOfWeek | Calendar.GetHour | Calendar.GetSecond | Calendar.GetMilliseconds

Return to top


Overridden Method: GetMonth(
   DateTime time
)
Summary
Returns the month in the specified DateTime.
C# Syntax:
public override int GetMonth(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer between 1 and 13 that represents the month in the specified DateTime.
See also:
DateTime.Month | HebrewCalendar.GetEra | HebrewCalendar.GetYear | HebrewCalendar.GetDayOfYear | HebrewCalendar.GetDayOfMonth | HebrewCalendar.GetDayOfWeek

Return to top


Overloaded Method: GetMonthsInYear(
   int year
)
Inherited
See base class member description: System.Globalization.Calendar.GetMonthsInYear

Summary
Returns the number of months in the specified year in the current era.
C# Syntax:
public virtual int GetMonthsInYear(
   int year
);
Parameters:

year

An integer that represents the year.

Return Value:
The number of months in the specified year in the current era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.
See also:
Calendar.GetDaysInYear | Calendar.GetDaysInMonth

Return to top


Overloaded Method: GetMonthsInYear(
   int year,
   int era
)
Summary
Returns the number of months in the specified year in the specified era.
C# Syntax:
public override int GetMonthsInYear(
   int year,
   int era
);
Parameters:

year

An integer that represents the year.

era

An integer that represents the era.

Return Value:
The number of months in the specified year in the specified era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Remarks
For example, this method returns 12 or 13, depending on whether year is a leap year.

This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

See also:
HebrewCalendar.Eras | HebrewCalendar.GetDaysInYear | HebrewCalendar.GetDaysInMonth

Return to top


Method: GetSecond(
   DateTime time
)
Inherited
See base class member description: System.Globalization.Calendar.GetSecond

Summary
Returns the seconds value in the specified DateTime.
C# Syntax:
public virtual int GetSecond(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer that represents the seconds in time.
Remarks
The returned value is an integer from 0 to 59.
See also:
DateTime.Second | Calendar.GetEra | Calendar.GetYear | Calendar.GetMonth | Calendar.GetWeekOfYear | Calendar.GetDayOfYear | Calendar.GetDayOfMonth | Calendar.GetDayOfWeek | Calendar.GetHour | Calendar.GetMinute | Calendar.GetMilliseconds

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetWeekOfYear(
   DateTime time,
   CalendarWeekRule rule,
   DayOfWeek firstDayOfWeek
)
Inherited
See base class member description: System.Globalization.Calendar.GetWeekOfYear

Summary
Returns the week of the year that includes the date in the specified DateTime.
C# Syntax:
public virtual int GetWeekOfYear(
   DateTime time,
   CalendarWeekRule rule,
   DayOfWeek firstDayOfWeek
);
Parameters:

time

The DateTime to read.

rule

A CalendarWeekRule value that defines a calendar week.

firstDayOfWeek

A DayOfWeek value that represents the first day of the week.

Return Value:
An integer that represents the week of the year that includes the date in time.
Exceptions
Exception Type Condition
ArgumentOutOfRangeException firstDayOfWeek is outside the range supported by the calendar.

-or-

rule is not a valid CalendarWeekRule value.

Remarks
DateTimeFormatInfo.FirstDayOfWeek of CultureInfo.DateTimeFormat contains the default DayOfWeek value that represents the first day of the week for a specific culture.

DateTimeFormatInfo.CalendarWeekRule of CultureInfo.DateTimeFormat contains the default CalendarWeekRule value that defines a calendar week for a specific culture.

This method can also be used to determine the number of weeks in the year by setting time to the last day of the year.

See also:
DateTime | CalendarWeekRule | DayOfWeek | Calendar.GetEra | Calendar.GetYear | Calendar.GetMonth | Calendar.GetDayOfYear | Calendar.GetDayOfMonth | Calendar.GetDayOfWeek | Calendar.GetHour | Calendar.GetMinute | Calendar.GetSecond | Calendar.GetMilliseconds

Return to top


Overridden Method: GetYear(
   DateTime time
)
Summary
Returns the year in the specified DateTime.
C# Syntax:
public override int GetYear(
   DateTime time
);
Parameters:

time

The DateTime to read.

Return Value:
An integer between 1 and 9999 that represents the year in the specified DateTime.
Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).
See also:
DateTime.Year | HebrewCalendar.GetEra | HebrewCalendar.GetMonth | HebrewCalendar.GetDayOfYear | HebrewCalendar.GetDayOfMonth | HebrewCalendar.GetDayOfWeek

Return to top


Overloaded Method: IsLeapDay(
   int year,
   int month,
   int day
)
Inherited
See base class member description: System.Globalization.Calendar.IsLeapDay

Summary
Determines whether the specified date in the current era is a leap day.
C# Syntax:
public virtual bool IsLeapDay(
   int year,
   int month,
   int day
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

day

An integer that represents the day.

Return Value:
true if the specified day is a leap day; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

day is outside the range supported by the calendar.

Remarks
In order to make up for the difference between the calendar year and the actual time that the earth rotates around the sun or the actual time that the moon rotates around the earth, a leap year has a different number of days than a standard calendar year. Each Calendar implementation defines leap years differently.

A leap day is a day that occurs only in a leap year. For example, in the Gregorian calendar, the 29th day of February is the only leap day.

See also:
Calendar.GetMonthsInYear | Calendar.GetDaysInMonth | Calendar.IsLeapYear | Calendar.IsLeapMonth

Return to top


Overloaded Method: IsLeapDay(
   int year,
   int month,
   int day,
   int era
)
Summary
Determines whether the specified date in the specified era is a leap day.
C# Syntax:
public override bool IsLeapDay(
   int year,
   int month,
   int day,
   int era
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

day

An integer that represents the day.

era

An integer that represents the era.

Return Value:
true if the specified day is a leap day; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

day is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

In every 19-year cycle that ends with a year that is evenly divisible by 19, the 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years are leap years. A common year can have from 353 to 355 days, depending on the placement of Jewish holidays. A leap year can have from 383 to 385 days.

A leap day is a day that occurs only in a leap year. In the Hebrew calendar, the last day of Adar Alef and all the days in Adar Beit are considered leap days.

See also:
HebrewCalendar.Eras | HebrewCalendar.GetMonthsInYear | HebrewCalendar.GetDaysInMonth | HebrewCalendar.IsLeapYear | HebrewCalendar.IsLeapMonth

Return to top


Overloaded Method: IsLeapMonth(
   int year,
   int month
)
Inherited
See base class member description: System.Globalization.Calendar.IsLeapMonth

Summary
Determines whether the specified month in the specified year in the current era is a leap month.
C# Syntax:
public virtual bool IsLeapMonth(
   int year,
   int month
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

Return Value:
true if the specified month is a leap month; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

Remarks
In order to make up for the difference between the calendar year and the actual time that the earth rotates around the sun or the actual time that the moon rotates around the earth, a leap year has a different number of days than a standard calendar year. Each Calendar implementation defines leap years differently.

A leap month is an entire month that occurs only in a leap year. For example, in the Hebrew calendar, Veadar is the only leap month.

See also:
Calendar.GetMonthsInYear | Calendar.IsLeapYear | Calendar.IsLeapDay

Return to top


Overloaded Method: IsLeapMonth(
   int year,
   int month,
   int era
)
Summary
Determines whether the specified month in the specified year in the specified era is a leap month.
C# Syntax:
public override bool IsLeapMonth(
   int year,
   int month,
   int era
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

era

An integer that represents the era.

Return Value:
true if the specified month is a leap month; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

In every 19-year cycle that ends with a year that is evenly divisible by 19, the 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years are leap years. A common year can have from 353 to 355 days, depending on the placement of Jewish holidays. A leap year can have from 383 to 385 days.

A leap month is an entire month that occurs only in a leap year. In the Hebrew calendar, Adar Beit is the only leap month.

See also:
HebrewCalendar.Eras | HebrewCalendar.GetMonthsInYear | HebrewCalendar.IsLeapYear | HebrewCalendar.IsLeapDay

Return to top


Overloaded Method: IsLeapYear(
   int year
)
Inherited
See base class member description: System.Globalization.Calendar.IsLeapYear

Summary
Determines whether the specified year in the current era is a leap year.
C# Syntax:
public virtual bool IsLeapYear(
   int year
);
Parameters:

year

An integer that represents the year.

Return Value:
true if the specified year is a leap year; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.
Remarks
In order to make up for the difference between the calendar year and the actual time that the earth rotates around the sun or the actual time that the moon rotates around the earth, a leap year has a different number of days than a standard calendar year. Each Calendar implementation defines leap years differently.
See also:
Calendar.IsLeapMonth | Calendar.IsLeapDay

Return to top


Overloaded Method: IsLeapYear(
   int year,
   int era
)
Summary
Determines whether the specified year in the specified era is a leap year.
C# Syntax:
public override bool IsLeapYear(
   int year,
   int era
);
Parameters:

year

An integer that represents the year.

era

An integer that represents the era.

Return Value:
true if the specified year is a leap year; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

In every 19-year cycle that ends with a year that is evenly divisible by 19, the 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years are leap years. A common year can have from 353 to 355 days, depending on the placement of Jewish holidays. A leap year can have from 383 to 385 days.

See also:
HebrewCalendar.Eras | HebrewCalendar.IsLeapMonth | HebrewCalendar.IsLeapDay

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overloaded Method: ToDateTime(
   int year,
   int month,
   int day,
   int hour,
   int minute,
   int second,
   int millisecond
)
Inherited
See base class member description: System.Globalization.Calendar.ToDateTime

Summary
Returns a DateTime that is set to the specified date and time in the current era.
C# Syntax:
public virtual DateTime ToDateTime(
   int year,
   int month,
   int day,
   int hour,
   int minute,
   int second,
   int millisecond
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

day

An integer that represents the day.

hour

An integer that represents the hour.

minute

An integer that represents the minute.

second

An integer that represents the second.

millisecond

An integer that represents the millisecond.

Return Value:
The DateTime that is set to the specified date and time in the current era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

day is outside the range supported by the calendar.

-or-

hour is less than zero or greater than 23.

-or-

minute is less than zero or greater than 59.

-or-

second is less than zero or greater than 59.

-or-

millisecond is less than zero or greater than 999.

See also:
DateTime | Calendar.GetMonthsInYear | Calendar.GetDaysInMonth

Return to top


Overloaded Method: ToDateTime(
   int year,
   int month,
   int day,
   int hour,
   int minute,
   int second,
   int millisecond,
   int era
)
Summary
Returns a DateTime that is set to the specified date and time in the specified era.
C# Syntax:
public override DateTime ToDateTime(
   int year,
   int month,
   int day,
   int hour,
   int minute,
   int second,
   int millisecond,
   int era
);
Parameters:

year

An integer that represents the year.

month

An integer that represents the month.

day

An integer that represents the day.

hour

An integer that represents the hour.

minute

An integer that represents the minute.

second

An integer that represents the second.

millisecond

An integer that represents the millisecond.

era

An integer that represents the era.

Return Value:
The DateTime that is set to the specified date and time in the current era.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.

-or-

month is outside the range supported by the calendar.

-or-

day is outside the range supported by the calendar.

-or-

hour is less than zero or greater than 23.

-or-

minute is less than zero or greater than 59.

-or-

second is less than zero or greater than 59.

-or-

millisecond is less than zero or greater than 999.

-or-

era is outside the range supported by the calendar.

Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).
See also:
DateTime | HebrewCalendar.Eras | HebrewCalendar.GetMonthsInYear | HebrewCalendar.GetDaysInMonth

Return to top


Overridden Method: ToFourDigitYear(
   int year
)
Summary
Converts the specified two-digit year to a four-digit year by using the HebrewCalendar.TwoDigitYearMax property to determine the appropriate century.
C# Syntax:
public override int ToFourDigitYear(
   int year
);
Parameters:

year

A two-digit integer that represents the year to convert.

Return Value:
An integer that contains the four-digit representation of year.
Exceptions
Exception Type Condition
ArgumentException year is outside the range supported by the calendar.
Remarks
This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 6000 (1582 to 2240 in the Gregorian calendar).

HebrewCalendar.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 HebrewCalendar.TwoDigitYearMax is set to 5729, the 100-year range is from 5630 to 5729; therefore, a 2-digit value of 30 is interpreted as 5630, while a 2-digit value of 29 is interpreted as 5729.

See also:
HebrewCalendar.TwoDigitYearMax

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.