.NetCore string转换DateTime 电脑版发表于:2022/1/25 17:13 ```csharp string[] format = { "MM/dd/yyyy hh:mm:ss tt", "M/dd/yyyy hh:mm:ss tt", "MM/dd/yyyy h:m:s tt", "M/dd/yyyy h:m:s tt", "M/d/yyyy h:m:s tt" }; if (DateTime.TryParseExact(list[c].InnerText.ToString(), format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dttime)) { info.SetValue(obj, dttime); } ``` tn2>例如:`"5/8/2018 2:33:51 PM"`