Get the complete month name in English

前端 未结 6 582
予麋鹿
予麋鹿 2021-01-17 07:31

I use DateTime.Now.ToString(\"MMMM\") in order to get the current month\'s full name. It works well, but I get it in Hebrew.
Is there an option to

6条回答
  •  庸人自扰
    2021-01-17 08:05

    Use the overload that takes a IFormatProvider:

      CultureInfo culture = new CultureInfo("en-GB");
      DateTime.Now.ToString("MMMM", culture));
    

    Source

提交回复
热议问题