如何以法国文化(fr-FR)格式显示当前日期? [英] How to display current date in French culture(fr-FR) format ?

查看:601
本文介绍了如何以法国文化(fr-FR)格式显示当前日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我遇到了将英语日期显示为法语格式的问题.
我想以法国文化(fr-FR)格式显示当前日期,如下所示:

英文日期:01/20/2011 08:23 pm
法语的日期:20/01/2011 20:23

在这方面有人可以帮忙吗?

先谢谢了 !! ;)

Hi,

I''m facing an issue displaying English date to French format.
I want to display current date in French culture(fr-FR) format as example given below :

English date : 01/20/2011 08:23 pm
French date : 20/01/2011 20:23

Could anybody help in this regard.

Thanks in advanced !! ;)

推荐答案

我觉得我必须指出您使用的示例:

英语日期:2011年1月20日晚上8:23

不是英文日期.

英文日期格式与法语日期格式相同.

即日/月/年.

月/日/年是美国人使用的完全不合逻辑的命令.


但是确定将其分配给法国文化肯定足以正确显示日期吗?

CultureInfo("fr-FR")应该可以解决问题.
I feel I must point out that the example you used:

English date : 01/20/2011 08:23 pm

Is not the English Date.

The English Date Format is the same as the French Date Format.

ie Day/Month/Year.

Month/Day/Year is the totally illogical order used by Americans.


But surely just assigning it to the French Culture will be enough for the Date to be presented properly?

CultureInfo("fr-FR") should do the trick.


大家好,

我一直在寻找解决方案,

我编写了以下代码,以法国文化格式显示日期,如下所示:

Now.ToString(Globalization.CultureInfo.CreateSpecificCulture("fr-FR"))

感谢您的宝贵意见.
Rahul Chitte:)
Hi All,

I got solution wht i was looking for ,

I wrote following code to display date in french culture format as given below :

Now.ToString(Globalization.CultureInfo.CreateSpecificCulture("fr-FR"))

Thanks for all your valuable inputs.
Rahul Chitte :)


临时执行此操作很容易.阅读此内容:

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx [ ^ ].

但是,在同一应用程序的同一运行时间中混合文化吗?嗯...

如果要更改应用程序的区域性,则Abhinav的参考可能需要额外的注释.您还需要了解
Doing this ad hoc is easy. Read this:

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^].

However, mixing up cultures in the same run-time of the same application? Hm...

If you want to change culture of the application, the reference by Abhinav may need an extra note. You also need to understand the difference between
System.Threading.Thread.CurrentThread.CurrentCulture<br />

System.Threading.Thread.CurrentThread.CurrentUICulture之间的区别.

请参阅Microsoft帮助中的描述.这是有关该主题的有趣的综合文章: http://www.devx.com/dotnet/Article/6997 [ ^ ].

Dr.Dobbs中的简短文章: http://www.drdobbs.com/windows/206901403 [ ^ ].

and System.Threading.Thread.CurrentThread.CurrentUICulture.

See the description in Microsoft help. This is an interesting comprehensive article on the topic: http://www.devx.com/dotnet/Article/6997[^].

Short and clear article in Dr.Dobbs: http://www.drdobbs.com/windows/206901403[^].


这篇关于如何以法国文化(fr-FR)格式显示当前日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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