Determines whether the specified date is tuesday. - CSharp System

CSharp examples for System:DateTime Day

Description

Determines whether the specified date is tuesday.

Demo Code


using System;//w  w w  .  j  ava  2s . co m

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

Related Tutorials