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.TryParse(dateTime, out dt);
This should work based on your example "2011-29-01 12:00 am"
DateTime dt; DateTime.TryParseExact(dateTime, "yyyy-dd-MM hh:mm tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt);