HebrewCalendar.ToDateTime 方法

定義

傳回在指定紀元中設定為指定日期和時間的 DateTime

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

表示年份的整數。

month
Int32

從 1 到 13 的整數,表示月份。

day
Int32

從 1 到 30 的整數,表示日期。

hour
Int32

從 0 到 23 的整數,表示小時。

minute
Int32

從 0 到 59 的整數,表示分鐘。

second
Int32

從 0 到 59 的整數,表示秒鐘。

millisecond
Int32

從 0 到 999 的整數,表示毫秒。

era
Int32

表示紀元的整數。 請指定 HebrewEraHebrewCalendar.Eras[Calendar.CurrentEra]

傳回

DateTime,設定為目前紀元中指定的日期和時間。

例外狀況

yearmonthdayera 在目前 HebrewCalendar 物件所支援的範圍之外。

-或-

hour 小於 0 或大於 23。

-或-

minute 小於 0 或大於 59。

-或-

second 小於 0 或大於 59。

-或-

millisecond 小於 0 或大於 999。

備註

方法 ToDateTime 很有用,因為它可以將目前行事曆中的任何日期轉換成公曆日期。 例如,您可以後續使用公曆日期來比較不同行事曆中的日期,或在特定行事曆中建立相等的日期。

這個類別的 HebrewCalendar 實作只會辨識公曆 (1583 到 2239 年的希伯來文年份 5343 到 5999 年) 。

適用於

另請參閱