Is Week End - CSharp System

CSharp examples for System:DateTime Week

Description

Is Week End

Demo Code


using System;/*  ww  w.  j av a  2s.  co  m*/

public class Main{
        public static bool IsWeekEnd(this DateTime instance)
        {
            return instance.DayOfWeek == DayOfWeek.Saturday ||
                   instance.DayOfWeek == DayOfWeek.Sunday;
        }
}

Related Tutorials