Determines whether the specified date is monday. - CSharp System

CSharp examples for System:DateTime Day

Description

Determines whether the specified date is monday.

Demo Code


using System;//w  ww . j  a v a 2  s.  c  om

public class Main{
        /// <summary>
        ///     Determines whether the specified date is monday.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public static bool IsMonday(this DateTime date)
        {
            DayOfWeek dayOfWeek = date.DayOfWeek;
            bool isMonday = dayOfWeek == DayOfWeek.Monday;
            return isMonday;
        }
}

Related Tutorials