|
DateTime datetime;
string dateStringFormat = "5/26/2009"; // in your case set the TextBox value here
if (DateTime.TryParse(dateStringFormat, out datetime)) //If the string has a valid format then convert it to appropriate format
{
Response.Write("String is a valid DateTime format");
//do something
}
else
{
Response.Write("String is Not a valid DateTime format");
}
|