Is Weekday - CSharp System

CSharp examples for System:DateTime Week

Description

Is Weekday

Demo Code

//      Copyright (c) 2014-2015 OSharp. All rights reserved.
using System.Linq;
using System;//w w w  .  ja va 2 s .c o  m

public class Main{
        public static bool IsWeekday(this DateTime dateTime)
        {
            DayOfWeek[] weeks = { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday };
            return weeks.Contains(dateTime.DayOfWeek);
        }
}

Related Tutorials