HebrewCalendar.ToDateTime Method

Definition

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

public:
 override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
public override DateTime ToDateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
override this.ToDateTime : int * int * int * int * int * int * int * int -> DateTime
Public Overrides Function ToDateTime (year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, millisecond As Integer, era As Integer) As DateTime

Parameters

year
Int32

An integer that represents the year.

month
Int32

An integer from 1 to 13 that represents the month.

day
Int32

An integer from 1 to 30 that represents the day.

hour
Int32

An integer from 0 to 23 that represents the hour.

minute
Int32

An integer from 0 to 59 that represents the minute.

second
Int32

An integer from 0 to 59 that represents the second.

millisecond
Int32

An integer from 0 to 999 that represents the millisecond.

era
Int32

An integer that represents the era. Specify either HebrewEra or HebrewCalendar.Eras[Calendar.CurrentEra].

Returns

The DateTime that is set to the specified date and time in the current era.

Exceptions

year, month, day or era is outside the range supported by the current HebrewCalendar object.

-or-

hour is less than 0 or greater than 23.

-or-

minute is less than 0 or greater than 59.

-or-

second is less than 0 or greater than 59.

-or-

millisecond is less than 0 or greater than 999.

Remarks

The ToDateTime method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar.

This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 5999 (1583 to 2239 in the Gregorian calendar).

Applies to

See also