我这里有种思路,刚学到得,希望对你有用,抛砖引玉
string convertTime = "2012-12-12 13:00:21 872";
DateTime mdate1 = DateTime.ParseExact(convertTime, "yyyy-MM-dd HH:mm:ss fff", null);
convertTime = "2012:12:12 13-00-21 872";
mdate1 = DateTime.ParseExact(convertTime, "yyyy:MM:dd HH-mm-ss fff", null);
Convert.ToDateTime("2010-01-01");
Convert.ToDateTime(string)
//{2012-12-12 00:00:00}
string time = "";
DateTime datetime;
time = "2012-12-12";
datetime = Convert.ToDateTime(time);
time = "2012.12.12";
datetime = Convert.ToDateTime(time);
time = "12.12";
datetime = Convert.ToDateTime(time);
应该是formate吧