Convert YYYYMMDD string to MM/DD/YYYY string

前端 未结 4 1987
庸人自扰
庸人自扰 2021-01-06 09:27

I have a date that is stored as a string in the format YYYYDDMM. I would like to display that value in a \'MM/DD/YYYY\' format. I am programming in c#. The current code tha

4条回答
  •  旧巷少年郎
    2021-01-06 10:24

    Instead of DateTime.Parse(strOC31date); use DateTime.ParseExact() method, which takes format as one of the parameters.

提交回复
热议问题