Is Date - CSharp System

CSharp examples for System:DateTime

Description

Is Date

Demo Code


using System.Windows.Shapes;
using System.Windows.Media.Animation;
using System.Windows.Media;
using System.Windows.Input;
using System.Windows.Ink;
using System.Windows.Documents;
using System.Windows.Controls;
using System.Windows;
using System.Net;
using System;/*w w  w . ja  va2s.  c  o  m*/

public class Main{
        public static bool IsDate(object Expression)
        {
            DateTime dt;
            bool ret = false;
            try
            {
                DateTime.TryParse(zCStr(Expression), out dt);
                if (zCStr(Expression).Length != 10) ret = false;

                ret = true;
            }
            catch
            {
            }
            return ret;
        }
}

Related Tutorials