You will have to convert the string to a DateTime instance, and then
back. You can call the ParseExact method, passing in your format of
"YYYYMMDD" (you have to check the casing).
Once you have the result of that, you can call the ToString method on
the DateTime instance, passing in your new format.
Since you have no delimitor in your date string DateTime.Parse( ..) won't
work.
Try this ...
DateTime date = DateTime.ParseExact("20040326", "yyyyMMdd", null);
date.ToString("MM/dd/yyyy");
Regard,
Du
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.