var s = "dd/MM/yyyy"; var d = s.Split('/')[1] + "/" + s.Split('/')[0] + "/" + s.Split('/')[2];
obj.DOB = Convert.ToDateTime(d);
Quote:The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.
string oldstr = "03/12/2011"; string strDate = DateTime.ParseExact(oldstr, "dd/MM/yyyy",null).ToString("MM/dd/yyyy");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)