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

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

Use ParseExact

DateTime date = DateTime.ParseExact(this.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);

Use DateTime.ParseExact

this.Text="25/11/2019";

DateTime dt= DateTime.ParseExact(this.Text, "dd/MM/yyyy", null);

You can also modify the webconfig file with the following

<configuration>
   <system.web>
     <globalization culture="FR-fr"/>
   </system.web>
</configuration>
DateTime.Parse( "25/11/2019", CultureInfo.CreateSpecificCulture("fr-FR") );

 

 

2020-03-08