Changing Date format to en-us while culture is fr-ca(在文化为 fr-ca 时将日期格式更改为 en-us)
问题描述
我正在对一个法语网站进行本地化.但是我不应该将日期格式更改为法语.即使文化设置为 fr-ca,它也必须保持 en-us 格式,即当其余内容为法语时,日期格式仍应为英语(en-us).
I'm working on localizing a website in French. However I am not supposed to change the date format to French. It must remain as per en-us format even if the culture is set to fr-ca i.e, when rest of the contents are in French, the date format should still be in English(en-us).
推荐答案
出乎意料的是,我得到了一个非常简单的答案.在设置 Culture 和 UICulture 时,我需要做的就是将 Culture 属性设置为始终 en-us.这将导致始终以英文显示日期格式.
Surprisingly I got a very simple answer. While setting Culture and UICulture, all I need to do is to set the Culture Property to en-us always. This will result in showing the date format in English always.
这篇关于在文化为 fr-ca 时将日期格式更改为 en-us的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在文化为 fr-ca 时将日期格式更改为 en-us


基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01