Is Equal Date - CSharp System

CSharp examples for System:DateTime Compare

Description

Is Equal Date

Demo Code


using System;//  ww w.  ja  va 2 s  .  c  o  m

public class Main{
        public static bool IsEqualDate(this DateTime thisdate, DateTime? otherDate)
        {
            if (!otherDate.HasValue) return false;
            return thisdate.Year == otherDate.Value.Year
                && thisdate.Month == otherDate.Value.Month
                && thisdate.Day == otherDate.Value.Day;
        }
}

Related Tutorials