Converting string format to datetime in mm/dd/yyyy

前端 未结 6 1085
萌比男神i
萌比男神i 2020-11-27 18:39

I have to convert string in mm/dd/yyyy format to datetime variable but it should remain in mm/dd/yyyy format.

string strDate = DateTime.Now.ToString(\"MM/dd/         


        
6条回答
  •  甜味超标
    2020-11-27 19:16

    The following works for me.

    string strToday = DateTime.Today.ToString("MM/dd/yyyy");
    

提交回复
热议问题