How to get complete month name from DateTime

user728885 picture user728885 · Jul 20, 2011 · Viewed 302.8k times · Source

What is the proper way to get the complete name of month of a DateTime object?
e.g. January, December.

I am currently using:

DateTime.Now.ToString("MMMMMMMMMMMMM");

I know it's not the correct way to do it.

Answer

mservidio picture mservidio · Jul 20, 2011

Use the "MMMM" custom format specifier:

DateTime.Now.ToString("MMMM");