Hi
string dateString = "10112009";
string format = "ddMMyyyy";
DateTime dateTime;
if (DateTime.TryParseExact(dateString, format, CultureInfo.InvariantCulture,
DateTimeStyles.None, out dateTime))
{
Console.WriteLine(dateTime.ToString("YYYYMMDD"));
}
You will get date value in dateTime object then you can perform
dateTime.ToString("YYYYMMDD") and get desired value.