DateTime.Deconstruct 方法

定義

多載

Deconstruct(DateOnly, TimeOnly)

將這個 DateTime 實例解構為 DateOnlyTimeOnly

Deconstruct(Int32, Int32, Int32)

將這個 DateOnly 實例解構為 YearMonthDay

Deconstruct(DateOnly, TimeOnly)

來源:
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

將這個 DateOnly 實例解構為 YearMonthDay

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 實例的值。

適用於