asp.net中用户生日的日期本地化 [英] Date Localization in asp.net for user birthdays

查看:79
本文介绍了asp.net中用户生日的日期本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有来自美国和欧洲的用户.当他们输入出生日期时,如何在正确的月份和日期插入sql服务器数据库.

我想确保当提醒其他用户其在线好友生日时,他们的真实生日完全在另一个月内时不会出错.

谢谢

I have users from U.S and europe. When they enter their date of birth how do I insert into the sql server database the right month and day.

I want to make sure that there will be no mistake when it reminds other users of their online friends birthday that their real birthday is in a totally another month.

Thank you

推荐答案

全球化和本地化是一个完整的话题;您可以从这里开始: http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx [^ ].

在查看所有内容之前,您想听一个好的友好建议吗:如果您的网站是国际化的,请不要傻,也不要使用传统的数字格式作为日期.不要追随基于文化的这种高度可疑的国家真实性.只是不要-您的用户没有义务在其系统或浏览器中维护正确的区域性设置,也没有义务记住这些事情.这些民族环境根本不是理性的,也不是每个人都应尊重的;例如,说英语的人使用不同的日期/时间表示法,具体取决于国家/地区,有时甚至取决于个人喜好.

相反,请始终以易于理解的方式写任何日期,例如:
2011年12月28日; 2011年12月28日等-如果不使用本地化.

不要让自己有任何歧义.即使您使用的是2011年12月28日,也要始终提及它是dd/mm/yyyy或其他内容.做人吧!

—SA
Globalization and localization is a whole topic; you can start here: http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx[^].

Before looking at all that, would you rather listen to a good friendly advice: don''t be silly and don''t use traditional numeric formats for dates if your site is international. Don''t chase this highly questionable national authenticity based on culture. Just don''t — your users are not obliged to maintain right culture settings in their systems or browsers and are not obliged to even remember about such things. Those national settings are not rational at all and not respected by everyone; for example, English-speaking people use different date/time notation, depending on country and sometimes even personal preferences.

Instead, always write any dates in the humanly and human-readable way, such as:
December 28, 2011; 28th of December, 2011, etc. — if you use localization or not.

Don''t allow yourself any ambiguity. Even if you use 12/28/2011, always mention it is dd/mm/yyyy or something. Be a human being!

—SA


这篇关于asp.net中用户生日的日期本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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