Search This Blog

Monday, February 8, 2010

ASP.NET Date Format on Web Hosting

sometimes you need your application to behave in a specific culture behavior e.g. in Hebrew and not in English - in my case is the DataFormat issue between those two culture . in Hebrew (he-IL) its dd/mm/yyyy and in en-us its mm/dd/yyyy.
so in development everything works just fine , your laptop is set in the correct culture , your date foramt is set via the control panel and its all works just fine (the dates in your grid), after deploy it on the Host server, you see that your dates in the grid look like the en-us format , and you do not have any access to the hots control panel or somthing like that.

the simple solution is to override the globalization in your web.config file.
before the </SYSTEM.WEB> add the next line
<globalization culture="he-IL"> and you will see your dates in the grid in the right & expected format.

enjoy
Yaniv T