Tuesday, 4 December 2012

How to Convert String to DateTime C#

How to Convert String to DateTime C#



 DateTime dt2=DateTime.Parse(@"12-03-2012");
                Console.WriteLine(dt2.ToShortDateString());


output:

12/3/2012 12:00:00 AM