Monday, August 3, 2009

C# Check whether string is valid Date


There are many places where we need to validate whether the given string is a valid Date or not. The following simple method handy for the same...

private bool IsDate(string strDate)


DateTime dt;

bool boolIsDate = true;



dt = DateTime.Parse(strDate);




boolIsDate = false;


return boolIsDate;


Hope it Helpz...

4Z ~ Fauzi