我有以下格式的时间戳字符串 5/1/2012 3:38:27 PM
。我如何将它转换为 C# 中的 DateTime 对象
最佳答案
var date = DateTime.ParseExact("5/1/2012 3:38:27 PM",
"M/d/yyyy h:mm:ss tt",
CultureInfo.InvariantCulture);
关于c# - 在 C# 中将时间戳字符串转换为 DateTime 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16103186/