語言

DateTime.Deconstruct 方法

定義

多載

名稱 Description
Deconstruct(DateOnly, TimeOnly)

將此 DateTime 實例解構為 DateOnlyTimeOnly和 。

Deconstruct(Int32, Int32, Int32)

將此 DateOnly 實例解構為 Year、 Month、 Day和 。

Deconstruct(DateOnly, TimeOnly)

來源:
DateTime.cs
來源:
DateTime.cs
來源:
DateTime.cs
來源:
DateTime.cs

將此 DateTime 實例解構為 DateOnlyTimeOnly和 。

public:
 void Deconstruct([Runtime::InteropServices::Out] DateOnly % date, [Runtime::InteropServices::Out] TimeOnly % time);
public void Deconstruct(out DateOnly date, out TimeOnly time);
member this.Deconstruct : DateOnly * TimeOnly -> unit
Public Sub Deconstruct (ByRef date As DateOnly, ByRef time As TimeOnly)

參數

date
DateOnly

當此方法回傳時,代表 DateOnly 該 DateTime 實例的值。

time
TimeOnly

當此方法回傳時,代表 TimeOnly 該 DateTime 實例的值。

適用於

Deconstruct(Int32, Int32, Int32)

來源:
DateTime.cs
來源:
DateTime.cs
來源:
DateTime.cs
來源:
DateTime.cs

將此 DateOnly 實例解構為 Year、 Month、 Day和 。

public:
 void Deconstruct([Runtime::InteropServices::Out] int % year, [Runtime::InteropServices::Out] int % month, [Runtime::InteropServices::Out] int % day);
public void Deconstruct(out int year, out int month, out int day);
member this.Deconstruct : int * int * int -> unit
Public Sub Deconstruct (ByRef year As Integer, ByRef month As Integer, ByRef day As Integer)

參數

year
Int32

當此方法回傳時,代表 Year 該 DateTime 實例的值。

month
Int32

當此方法回傳時,代表 Month 該 DateTime 實例的值。

day
Int32

當此方法回傳時,代表 Day 該 DateTime 實例的值。

適用於