Skip to content

Monthname Method

kalit sikka

Asked Jul 5, 2006, 2:41 AM EDT1 answer
Share
LinkedInX
We have monthname method in VB.net, Is there any equivalent method in C#.net

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi,
    Cn get from .NET framework BUT gives an extra empty element.
    Take a look at:
    System.Globalization.DateTimeFormatInfo.CurrentInfo()
     and its MonthNames() method which returns a string array of names BUT includes an empty element.

    What you could do is loop that array of month names and add all non-empty elements to an Arraylist or Hashtable...


    Using  the  System.Globalization.DateTimeFormatInfo.CurrentInfo()
    can also give you the short and long day names of the week with the following methods...
    AbbreviatedDayNames() and DayNames().

    Good luck
    sheir
    0