Try DateTime.TryParseExact
DateTime dt; DateTime.TryParseExact(textBox.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dt);
If you want to check multiple formats as you update in your question, you can use another TryParseExact overload TryParseExact , which takes the format parameter as an array of strings.
string[] formats = { "dd/MM/yyyy", "MM/dd/yyyy" }; DateTime.TryParseExact(txtBox.Text, formats, CultureInfo.InvariantCulture, DateTimeStyles.None, out value));
Pay attention to the format string. As you already noted the dd/mm/yyyy format. Here mm represents minute not month. Use mm to represent the month.
Sachin
source share