Get Month Name - CSharp System

CSharp examples for System:DateTime Month

Description

Get Month 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   www . j a  v  a2  s .  co  m

public class Main{
        public static string GetMonthName(int month)
      {
         switch (month)
         {
            case 1:
               return ("January");
            case 2:
               return ("February");
            case 3:
               return ("March");
            case 4:
               return ("April");
            case 5:
               return ("May");
            case 6:
               return ("June");
            case 7:
               return ("July");
            case 8:
               return ("August");
            case 9:
               return ("September");
            case 10:
               return ("October");
            case 11:
               return ("November");
            case 12:
               return ("December");
            default:
               return ("Illegal month");
         }
      }
}

Related Tutorials