Convert Date from 6/05/2020 format to dd/MM/YYYY format

后端 未结 5 1168
面向向阳花
面向向阳花 2020-12-03 18:24

I am facing a small issue which i am not able after trying so many things so here it goes ..... There is a text box in my page in which i am entering date and i want that da

5条回答
  •  时光取名叫无心
    2020-12-03 19:12

    Try DateTime.Parse with an appropriate format provider. In your case it should be

    IFormatProvider culture = new CultureInfo("de-DE", true);
    DateTime.Parse(txtDate.Text, culture );
    

提交回复
热议问题