如何将日期时间字符串December 13, 2015 09:55 PM
转换为DateTime
?
答案 0 :(得分:1)
试试这个
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string strDate = "December 13, 2015 09:55 PM";
DateTime date = DateTime.ParseExact(strDate, "MMMM dd, yyyy hh:mm tt", CultureInfo.InvariantCulture);
}
}
}
答案 1 :(得分:0)
DateTime.Parse("December 13, 2015 09:55 PM")