string dateString = "01/31/2011"; string pattern = "MM/dd/yyyy"; DateTime parsedDate = DateTime.Now; if (DateTime.TryParseExact(dateString, pattern, null, DateTimeStyles.None, out parsedDate)){ //parsedDate.ToShortDateString() //ready to be used as ShorDateString //.... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)