-3

How can I convert a datetime string like December 13, 2015 09:55 PM to a DateTime?

YWah
  • 561
  • 10
  • 34

2 Answers2

1

Try this

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

        }
    }
}
​
jdweng
  • 29,955
  • 2
  • 14
  • 18
0

DateTime.Parse("December 13, 2015 09:55 PM")

Konstantin Zadiran
  • 1,455
  • 2
  • 19
  • 33