DateFormat

  • I have a web interface that shows data from the SQL database. When I - on my machine with the same DB and the same web-interface - change a date field into '01-05-2000' (which is supposed to be the 1st of May 2000) it is representated at reopening as '01-05-2000' (which is correct). When my client changes the date into '01-05-2000' it comes out as '05-01-2000' (which is NOT correct).

    Their server and my PC are both set to Dutch date notation. So, how is it possible I still end up with an american representation?

    Does anyone have an answer, please?

  • I'm confused a little. Who has what date setting?

    Your PC

    Your SQL instance

    Server SQL Instance

    Server date settings

    client workstation settings

    This can get tricky as some date settings are handled by the client and some by the server. Don't forget the web server is the "client" for SQL Server.

  • When I do it, it's all done locally: The SQL db and the web-interface are both hosted on my PC.

    When the client does it both the web-interface and the SQL db are hosted on the server. They access the web-interface from their own PC.

    Both my PC and their server are set to the correct settings.

    Can the client's settings still influence the dateformat? Can I tell the db (or SQL) which kind of dateformat it should use?

    I hope this extra information clears the confusion.

  • Your web application needs to honor the "Language" preference, which would include date, and currency settings, chosen by the user in their browser. E.g., for U.S. English it is "en-us".

    So the web app needs to take the datetime from the database as an internal DATETIME format and then apply the language/culture value of the client's browser as it is converted to HTML as a string for eventual page rendering.


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

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