DateTime.Deconstruct Method

Definition

Overloads

Deconstruct(DateOnly, TimeOnly)

Deconstructs this DateTime instance by DateOnly and TimeOnly.

Deconstruct(Int32, Int32, Int32)

Deconstructs this DateOnly instance by Year, Month, and Day.

Deconstruct(DateOnly, TimeOnly)

Source:
DateTime.cs
Source:
DateTime.cs

Deconstructs this DateTime instance by DateOnly and TimeOnly.

public void Deconstruct (out DateOnly date, out TimeOnly time);

Parameters

date
DateOnly

When this method returns, represents the DateOnly value of this DateTime instance.

time
TimeOnly

When this method returns, represents the TimeOnly value of this DateTime instance.

Applies to

.NET 9 and .NET 8
Product Versions
.NET 8, 9

Deconstruct(Int32, Int32, Int32)

Source:
DateTime.cs
Source:
DateTime.cs

Deconstructs this DateOnly instance by Year, Month, and Day.

public void Deconstruct (out int year, out int month, out int day);

Parameters

year
Int32

When this method returns, represents the Year value of this DateTime instance.

month
Int32

When this method returns, represents the Month value of this DateTime instance.

day
Int32

When this method returns, represents the Day value of this DateTime instance.

Applies to

.NET 9 and .NET 8
Product Versions
.NET 8, 9