Why does:
DateTime.Now.ToString("M")
not return the month number? Instead it returns the full month name with the day on it.
Apparently, this is because “M” is also a standard code for the MonthDayPattern. I don’t want this…I want to get the month number using “M”. Is there a way to turn this off?
According to MSDN, you can use either
"%M","M "or" M"(note: the last two will also include the space in the result) to force M being parsed as the number of month format.