3

有人可以告诉我应该如何将以下格式转换为正确的DateTime对象吗?

11:50:46 AM on Wednesday, October 19, 2011
4

1 回答 1

12
        string s = "11:50:46 AM on Wednesday, October 19, 2011";
        DateTime dateTime = DateTime.ParseExact(s, 
            "hh:mm:ss tt on dddd, MMMM dd, yyyy", CultureInfo.InvariantCulture);
于 2012-07-11T13:17:06.020 回答