how to set a datetime variable in c# to a date code example Example: instantiate date time variable C# DateTime dtDate = new DateTime(2020,1,1);