HebrewCalendar.ToDateTime 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳設定為指定時代的日期與時間的 a 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的整數,代表毫秒。
傳回
DateTime那個設定在當前時代指定的日期和時間。
例外狀況
year, month, , dayera 超出當前 HebrewCalendar 物件所支持的範圍。
-或-
hour 小於0或大於23。
-或-
minute 小於0或大於59。
-或-
second 小於0或大於59。
-或-
millisecond 小於0或大於999。
備註
此 ToDateTime 方法之所以有用,是因為它能將當前曆法中的任何日期轉換為格里曆日期。 格里曆日期隨後可用於比較不同曆法中的日期,或在特定曆法中建立對應日期。
此類別的實作 HebrewCalendar 僅承認希伯來曆5343年至5999年(格里曆為1583年至2239年)。