Friday, June 14, 2013

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

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

 

Try using DateTime.ParseExact

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

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

No comments:

Post a Comment