set date on datetimepicker c# code example
Example 1: c# set datetime
var date1 = new DateTime(2008, 5, 1, 8, 30, 52);
Console.WriteLine(date1);
Example 2: how to select time and date in datetimepicker in c#
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "hh:mm:ss tt dd/MM/yyyy";
dateTimePicker1.ShowUpDown = true;
string dt = dateTimePicker1.Value.ToString("hh:mm:ss tt dd/MM/yyyy");