DateTime dt; if (DateTime.TryParseExact(str, "M/d/yyyy", null, DateTimeStyles.None, out dt) == true) { //your date is valid and is in dt }
DateTime.Parse(str);
if (DateTime.TryParseExact(str, "M/d/yyyy", null, DateTimeStyles.None, out dt) == true)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)