I am working on a program that requires the date of an event to get returned.
I am looking for a Date
, not a DateTime
.
Is there
The DateTime object has a Property which returns only the date portion of the value.
public static void Main()
{
System.DateTime _Now = DateAndTime.Now;
Console.WriteLine("The Date and Time is " + _Now);
//will return the date and time
Console.WriteLine("The Date Only is " + _Now.Date);
//will return only the date
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}