Wrong default date format

  • Hi,

    Apologies if this is in the wrong forum.

    I have an ASP.NET application that has recently been moved to a new server. It is connected to a SQL server 2000 database and is runing on a windows 2003 server with IIS 6. Since the server move, any date and currency items that are not formatted in the application are displaying as english (US) although all accounts have had the region set to English (UK). I have even checked the registry which also shows English (UK) The old server was backed up using NT backup and restored onto the new server so everything should be the same.

    Any ideas as to what I am missing?

    Thanks in advance

  • Two questions really,

    When you "moved to a new server", did you move the database, or change the account used to connect to the database?  Because SQL Server also stores a "language" setting for each account.  If you're outputting it from the database directly as a string (ie: without using localization or formatting in ASP), then it's not your Windows region that defines the format, but rather the format with which the date is output from the database.

    Try this on your database, either using the same account as ASP, or directly from ASP:

    SELECT @@LANGUAGE AS 'Language Name'

    If you see "us_english", then you'll get dates in mmddyy order.  If you see "British" (or "british_english" depending on your version and patch), you should get dates in ddmmyy order.  If you see something else, you've got other problems. 

    If you don't see the language you want, you can set it to the correct default value.  Conenct to the database again using the correct account, and run:

    EXEC sp_defaultlanguage 'asp_net', 'british'

    You can check it at any time after that using the @@Language variable.


    If you see the language you expected, then that isn't the problem.  In that case, you'll have to investigate the formatting strings used in your ASP pages.  If you've got a customized localization string, check that it works correctly.  If the format string isn't valid, it might simply default to US English.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply