String was not recognized as a valid DateTime “ format dd/MM/yyyy”

前端 未结 13 1129
一整个雨季
一整个雨季 2020-11-22 05:30

I am trying to convert my string formatted value to date type with format dd/MM/yyyy.

this.Text=\"22/11/2009\";

DateTime date = DateTime.Parse(         


        
相关标签:
13条回答
  • 2020-11-22 06:15

    Change Manually :

    string s = date.Substring(3, 2) +"/" + date.Substring(0, 2) + "/" + date.Substring(6, 4);
    

    From 11/22/2015 it will be converted in 22/11/2015

    0 讨论(0)
提交回复
热议问题