Our development team has 3 server environments: Development, UAT and Production. All of these servers were built and configured at the same time, with the same settings. The DEV and Production environments are fine but when our code is promoted from DEV to
UAT we are experiencing major issues with date formats when generating reports. We have written a test script to display the CurrentCulture.CultureInfo settings on both machines and have found that our DEV and PRODUCTION envoronments are English-US however
our UAT server is displaying English-CA. Now, it appears that a quick visit to the Regional Settings Control Panel should fix this but oddly enough, no matter what changes we make to these settings we cannot set the UAT server to return the US English cultural
settings. We are considering rebuilding the server but I would be interested to hear if anybody has experience or suggestions related to this issue which may point us in the right direction or at least discover the root of this issue so we can avoid it in
the future. Cheers, Dan.
Hi OzDan, We're having a similar issue on one of dev machines and have yet to find a fix, so I'm watching this thread and hopefully an answer will appear. Although I do not have an explaination for why your UAT box settings flip back to English-CA, you might
want to try forcing the web application Culture setting within the Web.config. Example:
We are having the same problem... it's driving me nuts!
The server was installed with a different language and since then all dates are shown in an incorrect format for our culture.
Adjusting the culture in regional settings doesn't help a bit.
Even forcing to use the correct culture (nl-BE) will not show the dates in our correct format: ???
Ok we had a 2003 server set up in en-US. Then, because of the wrong dateformats, we changed it to nl-BE.
Now, even when I programmaticaly set the culture to nl-BE, the dateformat is still incorrect (keeps taking en-US!). If i put a calendar control on the page, it is correctly shown in the right culture (nl-BE) but the dates are still en-US.
But when i programmaticly set another culture, for example nl-NL, the dates are correct! (no longer en-US). Anyone see any logic in this? The dates seem te be right,
except for the language i have put in regional settings (?).
Is this a bug?? There seem to be quite a few posts about this in this forum, but never a satisfying answer.
Couldn't find anything on MSDN also.
I just had a similar problem today - my machine was beliving that she is an us-en machine although all regional settings where set to german(Austria).
I was allready close to reinstall the machine - but then i tried to switch it to German(Germany) - because of this it asked me, if I want to reinstall these settings from harddisk or original compact disc. So - I have choosen the cd - and it automatically
asked me for a reboot.
After rebooting, i switched everything back to german(Austria) and it asked me again for reinstallation - which I agreed. And after reboot everything was also with german (Austria) fine.
The regional settings work fine for other applications on Windows 2003 Server, for example if I set a header date in Excel and then switch between EN-US and EN-GB (in regional settings) the date formats change back and forwards as expected. Therefore its something
to do with IIS and / or dotNet.
This article http://support.microsoft.com/?id=306044 although written for ASP, mentions ASP.NET, sounds very much like what I am suffereing from. It seems to be a matter of cascading security - what account
is IIS logged in as, etc. - article has not lead me to a solution, yet.
I can live with the globalization workround outlined above...
I have a server that is in Denmark built there and without the above web.config fix get the calendar language set as Danish and not UK.
Also the issue I have is that when I format a date on a GridView it works locally on my PC running a local IIS but not on this server, it may be related to this issue.
I have one web application created in asp.net. i hosted the website on one american server. As the site was on american server so i did all scripting for date checks and conversion by keeping in mind the format mm/dd/yyyy. Now after one and half year i have
switched my site from that server to new server but unfortunatly this new server is in uk and that is why the date format configured on server is dd/mm/yyyy.
As i have uploaded all the things on the server and have made it live as well so it is not possible for me to reinstall the server and change the date format i.e to change it to dd/mm/yyyy.
Now the problem i am facing is server side script is doing date checks and display in dd/mm/yyyy, which is not required.
I trued changing dateformat from global settings also but it didnt work although i was aware intitally also that it work. Because as per my exp i have concluded that somewhere in system the date format got stored at installation time and after that changing
that is not possible without re-installtion.
so, if anyone can help me how to change/set the date format in the application to mm/dd/yyyy, without re-installing the server. i think some thing like localize settings will have to do with it, but what i dont know...
As per my experience this problem is for all windows OS
C:\WINDOWS\Microsoft.NET\Framework(64 or 32)\<.net version>\Config
and add this to the <System.Web> section : <globalization culture="en-AU" uiCulture="en-AU" /> or <globalization culture="en-US" uiCulture="en-US" /> or <globalization culture="en-GB" uiCulture="en-GB" /> or whatever.
I have an american server and I solved this once and for all by altering the registery.
Change the regional settings in control panel to the settings you desire.
Open Regedit
Goto HKey_Users.
Now locate the class in there that has the international settings that you set (this will be your profile that your currently logged in as). They are in A sub folder e.g. .Default(It wont be default)->Control Panel->International.
Print screen this for future reference.
Start at the top (.Default) and work your way down replacing all the international settings in all the sub folders with the onces you've print screened.
Finally Reboot.
You'll find this completly fixes the problem, no hacks needed anywhere.
it appears that .NET takes the settings from one of those other login profiles that you cant actually log in as, so changing the regional settings for your current logged in profile has no effect.
OzDan
Member
5 Points
1 Post
Regional Settings issues on Windows Server 2003
Mar 04, 2005 03:34 PM|LINK
BasicDatePic...
Contributor
2037 Points
406 Posts
Re: Regional Settings issues on Windows Server 2003
Mar 04, 2005 04:51 PM|LINK
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />See also. Hope this helps.Basic Date Picker - A Quicker Picker(TM) - ASP.NET Calendar, Date and Time Web Controls
zoeloe
Member
40 Points
8 Posts
Re: Regional Settings issues on Windows Server 2003
Apr 21, 2005 01:09 PM|LINK
We are having the same problem... it's driving me nuts!
The server was installed with a different language and since then all dates are shown in an incorrect format for our culture.
Adjusting the culture in regional settings doesn't help a bit.
Even forcing to use the correct culture (nl-BE) will not show the dates in our correct format: ???
System.Threading.Thread.CurrentThread.CurrentCulture =
new CultureInfo("nl-BE");System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-BE");
Label1.Text = DateTime.Now+ " ---------- "+DateTime.Now.ToShortDateString();
Does anyone have an explanation for the latter behavior? Any help would be very much appreciated...
zoeloe
Member
40 Points
8 Posts
Re: Regional Settings issues on Windows Server 2003
Apr 21, 2005 02:13 PM|LINK
Ok we had a 2003 server set up in en-US. Then, because of the wrong dateformats, we changed it to nl-BE.
Now, even when I programmaticaly set the culture to nl-BE, the dateformat is still incorrect (keeps taking en-US!). If i put a calendar control on the page, it is correctly shown in the right culture (nl-BE) but the dates are still en-US.
But when i programmaticly set another culture, for example nl-NL, the dates are correct! (no longer en-US). Anyone see any logic in this? The dates seem te be right, except for the language i have put in regional settings (?).
Is this a bug?? There seem to be quite a few posts about this in this forum, but never a satisfying answer.
Couldn't find anything on MSDN also.
Thanks for any help.
Alexdotnet
Member
5 Points
1 Post
Re: Regional Settings issues on Windows Server 2003
Apr 21, 2005 06:53 PM|LINK
I just had a similar problem today - my machine was beliving that she is an us-en machine although all regional settings where set to german(Austria).
I was allready close to reinstall the machine - but then i tried to switch it to German(Germany) - because of this it asked me, if I want to reinstall these settings from harddisk or original compact disc. So - I have choosen the cd - and it automatically asked me for a reboot.
After rebooting, i switched everything back to german(Austria) and it asked me again for reinstallation - which I agreed. And after reboot everything was also with german (Austria) fine.
maybe it helps,
yours,
Alex
don_k
Member
15 Points
3 Posts
Re: Regional Settings issues on Windows Server 2003
Sep 19, 2005 02:02 PM|LINK
Am also seeing this issue.
The regional settings work fine for other applications on Windows 2003 Server, for example if I set a header date in Excel and then switch between EN-US and EN-GB (in regional settings) the date formats change back and forwards as expected. Therefore its something to do with IIS and / or dotNet.
This article http://support.microsoft.com/?id=306044 although written for ASP, mentions ASP.NET, sounds very much like what I am suffereing from. It seems to be a matter of cascading security - what account is IIS logged in as, etc. - article has not lead me to a solution, yet.
I can live with the globalization workround outlined above...
Don
Langy
Member
11 Points
33 Posts
Re: Regional Settings issues on Windows Server 2003
Jun 04, 2009 08:38 AM|LINK
Did anyone ever find a resolve to this?
I have a server that is in Denmark built there and without the above web.config fix get the calendar language set as Danish and not UK.
Also the issue I have is that when I format a date on a GridView it works locally on my PC running a local IIS but not on this server, it may be related to this issue.
Paul
NomanZafar
Member
8 Points
13 Posts
I am also having the same problem
Jun 04, 2009 09:18 AM|LINK
I have one web application created in asp.net. i hosted the website on one american server. As the site was on american server so i did all scripting for date checks and conversion by keeping in mind the format mm/dd/yyyy. Now after one and half year i have switched my site from that server to new server but unfortunatly this new server is in uk and that is why the date format configured on server is dd/mm/yyyy.
As i have uploaded all the things on the server and have made it live as well so it is not possible for me to reinstall the server and change the date format i.e to change it to dd/mm/yyyy.
Now the problem i am facing is server side script is doing date checks and display in dd/mm/yyyy, which is not required.
I trued changing dateformat from global settings also but it didnt work although i was aware intitally also that it work. Because as per my exp i have concluded that somewhere in system the date format got stored at installation time and after that changing that is not possible without re-installtion.
so, if anyone can help me how to change/set the date format in the application to mm/dd/yyyy, without re-installing the server. i think some thing like localize settings will have to do with it, but what i dont know...
As per my experience this problem is for all windows OS
Growls
Member
2 Points
1 Post
Re: I am also having the same problem
Oct 19, 2011 06:29 AM|LINK
Hi All, open your machine.config file located at:
C:\WINDOWS\Microsoft.NET\Framework(64 or 32)\<.net version>\Config
and add this to the <System.Web> section : <globalization culture="en-AU" uiCulture="en-AU" /> or <globalization culture="en-US" uiCulture="en-US" /> or <globalization culture="en-GB" uiCulture="en-GB" /> or whatever.
Globalization
JonathanArch...
Member
2 Points
1 Post
Re: I am also having the same problem
Jan 25, 2012 02:37 PM|LINK
I have an american server and I solved this once and for all by altering the registery.
Change the regional settings in control panel to the settings you desire.
Open Regedit
Goto HKey_Users.
Now locate the class in there that has the international settings that you set (this will be your profile that your currently logged in as). They are in A sub folder e.g. .Default(It wont be default)->Control Panel->International.
Print screen this for future reference.
Start at the top (.Default) and work your way down replacing all the international settings in all the sub folders with the onces you've print screened.
Finally Reboot.
You'll find this completly fixes the problem, no hacks needed anywhere.
it appears that .NET takes the settings from one of those other login profiles that you cant actually log in as, so changing the regional settings for your current logged in profile has no effect.
Globalization