Thursday, May 05, 2005

DateTime class in .NET (localization)

In ASP.NET, web.config contains a tag.

<globalization culture="en-GB" requestencoding="utf-8" responseencoding="utf-8">

When the culture is "en-US" and we print a DateTime object, we get it in the format "mm/dd/yyyy" whereas if U change the culture to "en-GB" then the date.toString() would return a string in the format "dd/mm/yyyy".So our code cannot assume the date, month to be in a specific format for parsing. Very very imp tip for localisation !!!!