开发者

How to convert a date which is given in CCYYMMDD format to MM/DD/CCYY using C#?

Can anyone help me to convert a date which is given in CCYYMMDD format to MM/DD/开发者_开发技巧CCYY format in C#.


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜