Alex Rivera | Logout

How to get the month name in C#?

Asked 2009-06-10T13:20:03.763
114

How does one go about finding the month name in C#? I don't want to write a huge switch statement or if statement on the month int. In VB.Net you can use MonthName(), but what about C#?

Edit
Report

1 Answer

132

Use the "MMMM" format specifier:

string month = dateTime.ToString("MMMM");
answered 2009-06-10T13:20:59.797

Your Answer