Convert DateTime to a specified Format

前端 未结 5 1123
长发绾君心
长发绾君心 2020-11-30 08:42

I have this date format yy/MM/dd HH:mm:ss ex: 12/02/21 10:56:09. The problem is, when i try to convert it to different format using this code:

5条回答
  •  日久生厌
    2020-11-30 09:38

    Even easier way to convert Date:

    Convert.ToDateTime("12/02/21 10:56:09").ToString("MMM.dd,yyyy HH:mm:ss");
    

提交回复
热议问题