How to get complete month name from DateTime

后端 未结 9 1521
慢半拍i
慢半拍i 2020-12-07 23:58

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

I am currently usi

9条回答
  •  误落风尘
    2020-12-08 00:13

    If you receive "MMMM" as a response, probably you are getting the month and then converting it to a string of defined format.

    DateTime.Now.Month.ToString("MMMM") 
    

    will output "MMMM"

    DateTime.Now.ToString("MMMM") 
    

    will output the month name

提交回复
热议问题