how to declare date in c#.net 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: instantiate date time variable C#
DateTime dtDate = new DateTime(2020,1,1);