views:

612

answers:

4

I've found a dilly of a pickle with a new web server. We have a new web server that is displaying dates differently than our old web servers.

We are running asp classic web pages on IIS 6.0 with windows server 2003.

We have logged in as an administrator and set the regional settings as appropriate and then applied the settings to current user and default user profile.

We then went into registry and update the appropriate formats under HKEY_USERS/.default/control panel/international.

Update the asp.net configuration for our websites to the correct code-page and locale.

Does anyone have other places that the application could be getting date formats from?

A: 

Classic ASP Defaults to the Locale ID that was configured when the server was Setup. If you have access to the original server run the following code to get Locale ID it's operating under and verify that the new server is using the same.

<%=Session.LCID%>

If the Locale IDs are different and you cannot change it on the new server then you can add a line to the Session_OnStart sub in the global.asa for the application that assigns the correct Locale ID to Session.LCID.

CptSkippy
A: 

Using an ASP page with the content:-

Response.Write GetLocale

Might be informative, it'll show you what locale VBScript thinks its using.

I've seen issues like this in the dim and distant past when using integrated security. The ASP caches the regional details from a user hive when it first needs to use them then continues to use those settings until the process dies. ASP gets these settings from the user hive associated with the user identity the code is currently running under. Most of the time that would be DEFAULT because the user doesn't have a profile on the system.

However if the user happens to have logged on interactively to the server they will have a profile and so their settings are used. Hence I've seen situations where the server appears to have intermitten problems with regional settings.

I can't recall if I've seen this on IIS6, I've definitely seen it on IIS5.

AnthonyWJones
+1  A: 

I know this isn't the 'proper' way to fix the issue. However, the application was written many years ago, getting something through planning/change control would be a pain, and is the only application running on the server. Thus it is okay to configure the server to cater to this single application. Besides it was driving me crazy that a new server that should be configured identically to an old server was not working.

It turns out that in addition to HKEY_USERS/*/Control Panel/international, there is a setting for non-unicode programs. It can be found under HKLM/system/currentcontrolset/control/nls/language/Default. Set that to the correct code page and it is golden.

On the other hand, if you prefer to not modify the registry directly, you can update all these values through the Regional settings from the control panel.

You can adjust the formats through the 'customize' button. You can change the 'language for non-unicode programs' under advanced tab. Just make sure that you check the 'apply to the default profile' at the bottom of the advanced tab.

yamspog
A: 

If you run your ASP application under a different account (not IUSR_Guest) Login as that account, set date/time format to what you want and restart IIS.

DmitryK