System.DateTime.Date Property

Gets the date component of this instance.

Syntax

public DateTime Date { get; }

Value

A new DateTime instance with the same date as the current instance, and the time value set to midnight (00:00:00).

Remarks

The value of the DateTime.Kind property of the returned DateTime value is the same as that of the current instance.

Because the DateTime type represents both dates and times in a single type, it is important to avoid misinterpreting a date returned by the DateTime.Date property as a date and time. For more information, see "Saving and Restoring DateTime Values" in the DateTime topic.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0