A DateTime extension method that query if 'date' is date equal. - CSharp System

CSharp examples for System:DateTime Calculate

Description

A DateTime extension method that query if 'date' is date equal.

Demo Code

// Copyright (c) 2015 ZZZ Projects. All rights reserved
using System;/*  w w w  . ja  v  a 2 s.c o m*/

public class Main{
        /// <summary>
    ///     A DateTime extension method that query if 'date' is date equal.
    /// </summary>
    /// <param name="date">The date to act on.</param>
    /// <param name="dateToCompare">Date/Time of the date to compare.</param>
    /// <returns>true if date equal, false if not.</returns>
    public static bool IsDateEqual(this DateTime date, DateTime dateToCompare)
    {
        return (date.Date == dateToCompare.Date);
    }
}

Related Tutorials