create datetime for specific date dotnet code example
Example 1: c# set datetime
var date1 = new DateTime(2008, 5, 1, 8, 30, 52);
Console.WriteLine(date1);
Example 2: instantiate date time variable C#
DateTime dtDate = new DateTime(2020,1,1);
var date1 = new DateTime(2008, 5, 1, 8, 30, 52);
Console.WriteLine(date1);
DateTime dtDate = new DateTime(2020,1,1);