//string time = "2019-01-18 13:50:38"; string time = "2019-01-18 13:50:38 256"; //俩种格式都能识别 r= DateTime.ParseExact(time, new string[] { "yyyy-MM-dd HH:mm:ss fff", "yyyy-MM-dd HH:mm:ss" }, System.Globalization.CultureInfo.CurrentCulture);