.net core 时间格式转换

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

 

posted on 2019-01-18 15:07  跨界农民工  阅读(3331)  评论(0)    收藏  举报

导航