Click here to Skip to main content
15,888,008 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

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
 
Share this answer
 
v2
Comments
Sridhar Patnayak 29-Dec-11 1:20am    
My vote of 5 - The way of suggestion is very nice , localization and globalization are suggestible here.
Sergey Alexandrovich Kryukov 29-Dec-11 1:44am    
Thank you, Sridhar.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900