Thursday, 7 July 2011

How to get MonthName from DateTime in C#?

Following syntax can be used to get month name from current date

4 letter format
DateTime.Now.ToString( "MMMM" )

3 letter format
DateTime.Now.ToString( "MMM" )

string CurrentMonth = String.Format("{0:MMMM}", DateTime.Now).ToString();


Click here for more custom DateTime format strings

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete