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

前端 未结 13 1140
一整个雨季
一整个雨季 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 05:56

    Worked for me below code:

    DateTime date = DateTime.Parse(this.Text, CultureInfo.CreateSpecificCulture("fr-FR"));
    

    Namespace

    using System.Globalization;
    

提交回复
热议问题