I would like to ask if it is a good coding practice to manually set the YearMonthPattern
of the CurrentCulture
? My problem is I set the current culture to Invariant
, and the YearMonthPattern
changed.
What I did is just added the code to set the YearMonthPattern
just after setting the Cultures.
//Set Cultures
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(127);
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(127);
//Set Year Month Pattern
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.YearMonthPattern = "MMMM, yyyy";