HebrewCalendar.ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) 方法

定義

傳回在指定紀元中設定為指定日期和時間的 DateTimeReturns 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

參數

year
Int32

表示年份的整數。An integer that represents the year.

month
Int32

從 1 到 13 的整數,表示月份。An integer from 1 to 13 that represents the month.

day
Int32

從 1 到 30 的整數,表示日期。An integer from 1 to 30 that represents the day.

hour
Int32

從 0 到 23 的整數,表示小時。An integer from 0 to 23 that represents the hour.

minute
Int32

從 0 到 59 的整數,表示分鐘。An integer from 0 to 59 that represents the minute.

second
Int32

從 0 到 59 的整數,表示秒鐘。An integer from 0 to 59 that represents the second.

millisecond
Int32

從 0 到 999 的整數,表示毫秒。An integer from 0 to 999 that represents the millisecond.

era
Int32

表示紀元的整數。An integer that represents the era. 請指定 HebrewEraHebrewCalendar.Eras[Calendar.CurrentEra]Specify either HebrewEra or HebrewCalendar.Eras[Calendar.CurrentEra].

傳回

DateTime,設定為目前紀元中指定的日期和時間。The DateTime that is set to the specified date and time in the current era.

例外狀況

yearmonthdayera 在目前 HebrewCalendar 物件所支援的範圍之外。year, month, day or era is outside the range supported by the current HebrewCalendar object.

-或--or- hour 小於 0 或大於 23。hour is less than 0 or greater than 23.

-或--or- minute 小於 0 或大於 59。minute is less than 0 or greater than 59.

-或--or- second 小於 0 或大於 59。second is less than 0 or greater than 59.

-或--or- millisecond 小於 0 或大於 999。millisecond is less than 0 or greater than 999.

備註

ToDateTime 方法很有用,因為它可以將目前行事曆中的任何日期轉換成西曆日期。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.

HebrewCalendar 類別的執行只會辨識希伯來文年份5343到5999(西曆中的1583到2239)。This implementation of the HebrewCalendar class recognizes only the Hebrew years 5343 to 5999 (1583 to 2239 in the Gregorian calendar).

適用於

另請參閱