Sunday, February 11, 2018

Validate Date in C#

DateTime dt;
if (DateTime.TryParseExact(str, "M/d/yyyy", null, DateTimeStyles.None, out dt) == true)
{
//your date is valid and is in dt
}

No comments :

Post a Comment