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
You can either set the culture of the thread:
DateTime dt = DateTime.Now;
// Sets the CurrentCulture property to U.S. English.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
// Displays dt, formatted using the ShortDatePattern
// and the CurrentThread.CurrentCulture.
Console.WriteLine(dt.ToString("MMMM"));
Or you can pass a CultureInfo
to the DateTime.ToString()
function.
// Creates a CultureInfo for U.S. English.
CultureInfo ci = new CultureInfo("en-US");
// Displays dt, formatted using the ShortDatePattern
// and the CultureInfo.
Console.WriteLine(dt.ToString("MMMM", ci));
Note that you could also choose CultureInfo.InvariantCulture.