How to resove the issue
String was not recognized as a valid DateTime
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 2, 2012, 7:33 AM EDT
MuthuMari MRank #5,738 · 288 reputationPosted May 2, 2012, 9:20 AM EDT
Try using
DateTime.ParseExact.this.Text="22/11/2009"; DateTime date = DateTime.ParseExact(this.Text, "dd/MM/yyyy", null);thanks.
If this post is useful then mark it as "Accepted Answer"
Kunal VaishyaRank #990 · 2K reputationPosted May 2, 2012, 10:04 AM EDT
DateTime date = DateTime.ParseExact(this.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);