MVC 5 全球化文化

MVC 5 globalization culture

我正在编写一个正在部署到 Azure 的 MVC 5 互联网应用程序。我想设置基于浏览器的文化,以便 DateTime 值以针对不同文化的正确格式显示。

这是我的 web.config 代码:

<globalization culture="auto:en-US" uiCulture="auto:en-US" enableClientBasedCulture="true"/>

这就是所有需要做的吗?在网站发布到 Azure 后查看视图时,只有 IE 以我当前的 OS 格式显示 DateTime。 Google Chrome 和 Firefox 都没有使用我当前的 OS 格式。

为什么 DateTime 值没有以我当前的文化格式(en-NZ)显示

提前致谢。

编辑

我已从 web.config 代码中删除了 enableClientBasedCulture="true",但浏览器仍未显示正确文化中的 DateTime 值。

documentation for the globalization Element (.NET 4) 开始,该属性目前不执行任何操作。

enableClientBasedCulture:

Optional attribute. This attribute is not in use at this time.