tags:

views:

101

answers:

3

I used the following c# syntax to get month name from month no but i get August i want only Aug..

System.Globalization.DateTimeFormatInfo mfi = new 
                                      System.Globalization.DateTimeFormatInfo();
        string strMonthName = mfi.GetMonthName(8).ToString();

Any suggestion...

+4  A: 

You want GetAbbreviatedMonthName

AakashM
+7  A: 

Replace GetMonthName with GetAbbreviatedMonthName so that it reads:

string strMonthName = mfi.GetAbbreviatedMonthName(8);
Lasse V. Karlsen
+6  A: 

You could also try:

string monthName = new DateTime(2010, 8, 1)
    .ToString("MMM", CultureInfo.InvariantCulture);
Darin Dimitrov