UmAlQuraCalendar.ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) Method

Definition

Returns a DateTime that is set to the specified date, time, and 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

A year.

month
Int32

An integer from 1 through 12 that represents a month.

day
Int32

An integer from 1 through 29 that represents a day.

hour
Int32

An integer from 0 through 23 that represents an hour.

minute
Int32

An integer from 0 through 59 that represents a minute.

second
Int32

An integer from 0 through 59 that represents a second.

millisecond
Int32

An integer from 0 through 999 that represents a millisecond.

era
Int32

An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or UmAlQuraEra.

Returns

DateTime

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 UmAlQuraCalendar class.

-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.

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.

Applies to