代码如下:
string year, month, day, hour, minute, second;
year = "2006";
month = "12";
day = "14";
hour = "11";
minute = "22";
second = "11";
string date = String.Format("{0}-{1}-{2} {3}:{4}:{5}", year, month, day, hour, minute, second);
dateTimePicker1.Value = Convert.ToDateTime(date);
说明:关于日期的格式,有两种"{0}-{1}-{2} {3}:{4}:{5}",或"{3}:{4}:{5}"。