//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);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-08-31
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案