c# date field validation
using System;
public class Program
{
public static void Main()
{
DateTime temp;
if(DateTime.TryParse("2021-08-21", out temp))
{
Console.WriteLine("Is Valid Date");
}
else
{
Console.WriteLine("Is not Valid Date");
}
}
}