TaiwanCalendar.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 到 12 的整數,表示月份。

day
Int32

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

hour
Int32

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

minute
Int32

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

second
Int32

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

millisecond
Int32

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

era
Int32

表示紀元的整數。

傳回

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

例外狀況

year 不在曆法支援的範圍內。

-或-

month 不在曆法支援的範圍內。

-或-

day 不在曆法支援的範圍內。

-或-

hour 小於 0 或大於 23。

-或-

minute 小於 0 或大於 59。

-或-

second 小於 0 或大於 59。

-或-

millisecond 小於 0 或大於 999。

-或-

era 不在曆法支援的範圍內。

適用於

另請參閱