I have a formatted datetime string and I want to convert it back to DateTime but when I parse or convert that string to DateTime it throws exceptio that string is not a valid dateTime.
Here is how DateTime string is created
string temp = dt.Year.ToString("D4") +
dt.Month.ToString("D2") +
dt.Day.ToString("D2") +
dt.Hour.ToString("D2") +
dt.Minute.ToString("D2") +
dt.Second.ToString("D2");
and here is how i am parsing it back to DateTime
DateTime dtchk = DateTime.Parse(temp);