在文化为 fr-ca 时将日期格式更改为 en-us [英] Changing Date format to en-us while culture is fr-ca

查看:26
本文介绍了在文化为 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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