Determines whether the specified date is thursday. - CSharp System

CSharp examples for System:DateTime Day

Description

Determines whether the specified date is thursday.

Demo Code


using System;//w  w  w .j  a v a  2s  .co  m

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

Related Tutorials