如何大写的ToLongDateString()结果ES-MX文化日期和月份的第一个字母? [英] how to uppercase date and month first letter of ToLongDateString() result in es-mx Culture?

查看:255
本文介绍了如何大写的ToLongDateString()结果ES-MX文化日期和月份的第一个字母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我从下面的C#线code时,在ES-MX文化

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日OCTUBRE日2008

我想获得以下

miércoles, 22 de octubre de 2008

i would like to obtain the following

我是否需要建立自己的文化?

do i need to Build my own culture?

推荐答案

您不需要建立自己的文化。你只需要更改的属性DateTimeFormat.DayNames和DateTimeFormat.MonthNames在当前的文化。

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.

        string[] newNames = { "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado", "Domingo" };
        Thread.CurrentThread.CurrentCulture.DateTimeFormat.DayNames = newNames;

然而,这是奇怪的是EN-美剧月份和日期与第一大写字母和MX-ES不是。

However, it's weird that en-US show months and days with the first uppercase letter and for mx-ES not.

希望它能帮助!

这篇关于如何大写的ToLongDateString()结果ES-MX文化日期和月份的第一个字母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆