Is Day Off - CSharp System

CSharp examples for System:DateTime Day

Description

Is Day Off

Demo Code


using System.Threading;
using System.Globalization;
using System.Collections.Generic;
using System;/*w ww  .j ava2 s  .c om*/

public class Main{
        private static bool IsDayOff(int year, int month, int day)
        {
            var dateTime = new DateTime(year, month, day);
            var dayOfWeek = dateTime.DayOfWeek;
            return (dayOfWeek == DayOfWeek.Sunday || dayOfWeek == DayOfWeek.Wednesday);
        }
}

Related Tutorials