Determines whether the specified date is wednesday. - CSharp System

CSharp examples for System:DateTime Day

Description

Determines whether the specified date is wednesday.

Demo Code


using System;/*w  ww .  ja v a2s .c  om*/

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

Related Tutorials