May 11, 2014
Gets the current date.
Assembly: mscorlib (in mscorlib.dll)
Because it returns the current date without the current time, the property is suitable for use in applications that work with dates only. In contrast, the TimeOfDay property returns the current time without the current date, and the Now property returns both the current date and the current time.
The following example uses the Date property to retrieve the current date. It also illustrates how a DateTime value can be formatted using some of the standard date and time format strings. Note that the output produced by the third call to the ToString(String) method uses the g format specifier to include the time component, which is zero.