Re: Date format for SQL Select Statements and Internationalization
From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 10/12/04
- Next message: Tibor Karaszi: "Re: System Index - how do I get rid of one on a user table?"
- Previous message: Aaron [SQL Server MVP]: "Re: System Index - how do I get rid of one on a user table?"
- In reply to: Mike Hubbard: "Date format for SQL Select Statements and Internationalization"
- Next in thread: Mike Hubbard: "Re: Date format for SQL Select Statements and Internationalization"
- Reply: Mike Hubbard: "Re: Date format for SQL Select Statements and Internationalization"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 12 Oct 2004 22:13:35 +0200
Regional setting has nothing to do with how SQL Server interprets datetime strings. The language for
a login does, and also, SET DATEFORMAT and SET LANGUAGE.
Two setting independent formats in SQL Server are unseparated 'YYYYMMDD hh:mm:ss' and ISO 8601
format 'YYYY-MM-DDThh:mm:ss'. What you refer to as the ISO format is *not* setting independent!
The regional setting of the client can of course affect all this if you just pass a date variable
straight to SQL Server without passing it through a proper format function.
http://www.karaszi.com/SQLServer/info_datetime.asp
-- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "Mike Hubbard" <Mike Hubbard@discussions.microsoft.com> wrote in message news:C7E9C538-6FCF-402C-A0B5-E35B377F4A0E@microsoft.com... > Is there a proper (read standard) format that we should be passing date/times > to SQL Server queries so that regardless of a user's Regional Settings or the > version of SQL Server (i.e. domestic MM/DD/YYYY HH:MM:SS or Int'l DD/MM/YYYY > HH:MM:SS) the query will be properly executed? Currently, regardless of the > regional settings of the user's PC or the language setting of SQL Server, the > only format that works between the two is MM/DD/YYYY HH:MM:SS. > > What if we send all dates and times in ISO format YYYY-MM-DD HH:MM:SS? Will > this format allow us to use this standard format irrespective of a user's > regional settings or the version of SQL Server, and have it properly executed > by SQL Server?
- Next message: Tibor Karaszi: "Re: System Index - how do I get rid of one on a user table?"
- Previous message: Aaron [SQL Server MVP]: "Re: System Index - how do I get rid of one on a user table?"
- In reply to: Mike Hubbard: "Date format for SQL Select Statements and Internationalization"
- Next in thread: Mike Hubbard: "Re: Date format for SQL Select Statements and Internationalization"
- Reply: Mike Hubbard: "Re: Date format for SQL Select Statements and Internationalization"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|