Failed to get month from current date

I am trying to extract the month from the current date, but in vain. I am using the code:

    Format(Today.Date, "mmmm")

      

However, when I try to run it to show the month like January, it displays 00. I thought it would work, but it doesn't. What can I do to get the month from the current date in vb.net using a simple approach like one function?

+3


source to share


3 answers


Try the following:

DateTime.Today.ToString("MMMM")

      



Check This for detailed date formatting options.

+8


source


try it



    MonthName(Now.Date.Month(),true)

      

+1


source


msdn: Custom Date and Time Format Strings

Format(Today.Date, "MMMM")

      

0


source







All Articles