c# string to datetime yyyymmdd code example
Example 1: c# string to datetime
string iDate = "05/05/2005";
DateTime oDate = Convert.ToDateTime(iDate);
MessageBox.Show(oDate.Day + " " + oDate.Month + " " + oDate.Year );
Example 2: c# format string to date yyyymmdd
DateTime dt = DateTime.ParseExact(dateString, "ddMMyyyy",
CultureInfo.InvariantCulture);
dt.ToString("yyyyMMdd");