IIS and regional settings

Mondeo

Centurion
Joined
Nov 10, 2006
Messages
128
Location
Sunny Lancashire
We have an application that works fine on our test server, however when we've uploaded it to production it fails.

Firstly as part of the logon process it inserts the date into a DB. This gives the following error

Arithmetic overflow error converting expression to data type datetime

The output of Now.ToString on the test server is

15/06/2007 14:12:26

On the production its

6/15/2007 2:11:52 PM

So its using a US date, i've been into regional settings on the web server and that seems fine, everything is set to UK.

Various articles on the net seem to suggest that the ASP.NET account has its own regional settings, could that be the problem?

If so how do I fix it?

To confirm the issue £ signs are also rendered as $

Thanks


Also pound signs are showing as dollars
 
this seems to be an issue with SQL Server's table definitions. Have you made sure that the DBase and tables in dev and prod were properly replicated?
 
You can control the culture the IIS box uses by use of the globalisation element in your web.config
i.e.
Code:
<globalization culture="en-uk" />

would use the UK as a locale rather than the server's defaults. IIRC .Net will normally attempt to treat information entered by the user based on the browser settings - this could cause issues if the users are expecting things to behave differently.

Either provide a means of validation and error reporting along with examples or possible be more flexible in what date formats you accept. An alternative input method could also clear this up - rather than the user typing a date in the could select day / month / year from a series of drop downs....

Just as a final thought - how are you inserting the date into the database?
 
Back
Top