Get Day Name - CSharp System

CSharp examples for System:DateTime Day

Description

Get Day Name

Demo Code


using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web.Security;
using System.Web;
using System.Configuration;
using System.Data;
using System;//from  w w  w  . j  a v  a2  s  . c  o m

public class Main{
        public static string GetDayName(int day)
      {
         switch (day)
         {
            case 1:
               return ("Sunday");
            case 2:
               return ("Monday");
            case 3:
               return ("Tuesday");
            case 4:
               return ("Wednesday");
            case 5:
               return ("Thursday");
            case 6:
               return ("Friday");
            case 7:
               return ("Saturday");
            default:
               return ("Illegal day");
         }
      }
}

Related Tutorials