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
基础教程推荐
- 如果条件可以为空 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 获取C#保存对话框的文件路径 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 将数据集转换为列表 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 从 C# 控制相机设备 2022-01-01
