Saturday, July 24, 2010

Get Month Name

Month Name in c#/VB.Net (August)

DateTimeFormatInfo.GetMonthName Method

s
tring strMonth = DateTime.Now.ToString("MMMM")

For the default invariant DateTimeFormatInfo, this method returns a string from the GregorianCalendar:
monthReturn Value
1"January"
2"February"
3"March"
4"April"
5"May"
6"June"
7"July"
8"August"
9"September"
10"October"
11"November"
12"December"
13""

Calendar objects can accommodate calendars with 13 months. For 12-month calendars, the empty string is always returned as the name of the 13th month.


Reff: http://msdn.microsoft.com/en-us/library/d4009dd5%28vs.71%29.aspx

No comments:

Post a Comment