Check whether string is a date or not?

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 937
public bool IsDate(string Text)
{
try
{
System.DateTime dt = System.DateTime.Parse(Text);
}
catch
{
return false;
}

return true;
}

Comments or Responses

Login to post response