I have the following date in string format \"2011-29-01 12:00 am\" . Now I am trying to convert that to datetime format with the following code:
DateTime.Try
That works:
DateTime dt = DateTime.ParseExact("2011-29-01 12:00 am", "yyyy-dd-MM hh:mm tt", System.Globalization.CultureInfo.InvariantCulture);