currently i obtain the below result from the following C# line of code when in es-MX Culture
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture = new
CultureInfo("es-mx");
<span><%=DateTime.Now.ToLongDateString()%></span>
miércoles, 22 de octubre de 2008
i would like to obtain the following
Miércoles, 22 de Octubre de 2008
do i need to Build my own culture?
The pattern of LongDate for Spanish (Mexico) is
according to Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongDatePattern. I guess you just have to manually convert the initial letters of the day and month to uppercase or you can use Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase and then replace "De" with "de".
You don't need to build your own culture. You only need to change the property DateTimeFormat.DayNames and DateTimeFormat.MonthNames in the current culture.
i.e.
However, it's weird that en-US show months and days with the first uppercase letter and for mx-ES not.
Hope it helps!.
a little late but this work for me!
first two Solutions works fine but what if we would like to extend this to any culture so i came up with this approach i change the current culture date time arrays into TitleCase
how can this be improved with out the Loop?