Answers for "c# validate datetime"

C#
0

c# Check Valid DateTime

public static bool IsDateTime(string dt)
{
    DateTime tmpDt;
    return DateTime.TryParse(dt, out tmpDt);
}
Posted by: Guest on October-05-2021
0

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");
		}
	}
}
Posted by: Guest on September-06-2021

C# Answers by Framework

Browse Popular Code Answers by Language