问题
Can anyone help me to convert a date which is given in CCYYMMDD format to MM/DD/CCYY format in C#.
回答1:
Assuming by "CC" you mean century, you should just parse it and reformat it:
DateTime date = DateTime.ParseExact("yyyyMMdd", text,
CultureInfo.InvariantCulture);
string newText = date.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
来源:https://stackoverflow.com/questions/6261143/how-to-convert-a-date-which-is-given-in-ccyymmdd-format-to-mm-dd-ccyy-using-c