Extracing the Date Part from a DateTime object

By [)ia6l0 iii
Access over 40 UI widgets with everything from interactive menus to rich charts.

Get date Only from the Datetime object in .Net

The DateTime object has the "Date" Property that helps you retreive the Date alone. See the following snippet:

DateTime fullDate = DateTime.Now;
string fullDateString = fullDate.ToString();

DateTime datealone = fullDate.Date;
string datealoneString = datealone.ToString("d");

Extracing the Date Part from a DateTime object  (566 Views)