set datetime.today to just date c# code example
Example 1: c# date
using System;
class Test {
static void Main() {
//print current datetime
Console.WriteLine (DateTime.Now.ToString());
//make a custom datetime
DateTime dt = new DateTime(2018, 7, 24);
Console.WriteLine (dt.ToString());
}
}
Example 2: c# get date without time
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;